c# - How to Draw Arc In windows phone 7 in canvas in Runtime? -


the challenge have make canvas object in runtime windows phone 7. , add arc on , startpoint , 1 end point . have tried code

    pathgeometry pathgeometry = new pathgeometry();     pathfigure figure = new pathfigure();     figure.startpoint = new point(150, 200);     figure.segments.add(     new arcsegment(     new point(300, 200),     new size(700, 100),     90,     false,     sweepdirection.clockwise,     true     )     );     pathgeometry.figures.add(figure);     path path = new path();     path.data = pathgeometry;     path.fill = brushes.pink;     path.stroke = brushes.green; 

now have add arc on canvas not take arguments . there other way . stuck .

well guess arc means type of figure, enter image description here

to draw arc, had used code , works fine me , quite similar code also, hope helps ..

 pathfigure pthfigure1 = new pathfigure();     pthfigure1.startpoint = new point(50, 60);// starting cordinates of arcs     arcsegment arcseg1 = new arcsegment();     arcseg1.point = new point(100, 82);   // ending cordinates of arcs     arcseg1.size = new size(10, 10);      arcseg1.islargearc = false;     arcseg1.sweepdirection = sweepdirection.clockwise;     arcseg1.rotationangle = 90;     pathsegmentcollection mypathsegmentcollection1 = new pathsegmentcollection();     mypathsegmentcollection1.add(arcseg1);     pthfigure1.segments = mypathsegmentcollection1;     pathfigurecollection pthfigurecollection1 = new pathfigurecollection();     pthfigurecollection1.add(pthfigure1);     pathgeometry pthgeometry1 = new pathgeometry();     pthgeometry1.figures = pthfigurecollection1;     system.windows.shapes.path arcpath1 = new system.windows.shapes.path();     arcpath1.data = pthgeometry1;     arcpath1.fill = new solidcolorbrush(color.fromargb(255, 255, 23, 0));     this.layoutroot.children.add(arcpath1); 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -