Note that there are some explanatory texts on larger screens.

plurals
  1. POJava drawArc() method on Windows phone
    text
    copied!<p>I would like to know if there is a simple way to draw an arc like in JAVA the <a href="http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/lcdui/Graphics.html#drawArc%28int,%20int,%20int,%20int,%20int,%20int%29" rel="nofollow noreferrer"><code>drawArc</code></a> method on Windows Phone.</p> <p>I would like to be able to do something like in this thread : <a href="https://stackoverflow.com/questions/6744350/how-can-i-draw-a-circle-sector-with-the-ellipse-class">How can I draw a circle sector with the ellipse class?</a> , but in a programmatic way.<br> I try to use <code>Path</code>, <code>PathGeometry</code> or <code>Ellipse</code> classes but I guess there must be something more simple.</p> <p>Thank you</p> <p>EDIT : I did this but I don't understand why my arc is not filled up correctly, if someone have a clue don't hesitate to share.</p> <pre><code> public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) { try { Deployment.Current.Dispatcher.BeginInvoke(() =&gt; { lock (this.UIElements) { Arc currentArc = new Arc(); currentArc.Height = (double)height; currentArc.Width = (double)width; currentArc.StartAngle = startAngle; currentArc.EndAngle = arcAngle; //Here I fill the Arc currentArc.ArcThickness = 999; currentArc.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Blue); // Canvas.SetLeft(currentArc, x); Canvas.SetTop(currentArc, y); Debug.WriteLine("fillArc hit ! Start Angle : " + startAngle + " End angle : " + arcAngle ); this.UIElements.Add(currentArc); } }); } catch (Exception e) { Debug.WriteLine(e.Message); } } </code></pre> <p><strong>EDIT 2</strong>: Code updated --> working</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload