Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Draw parabola using PathFigure and ArcSegment

$
0
0

Hey all,

I've been searching for some time now how to draw a parabola using ArcSegment. I've looked at all of the MSDN tutorials, but I cannot understand what parameters of ArcSegment mean. If I put an ArcSegment into PathFigure which has start point, why do I need both another point and width/height ? I need to make a program which takes one click for start position, second click for end position, and then move the mouse to adjust height of parabola. Simple as that. I used this code:

PathFigure f = new PathFigure();
            f.StartPoint = new Point(100,100);
            f.Segments.Add(new ArcSegment(new Point(200, 100),new Size( 100, 160),0,false,SweepDirection.Clockwise,true));

I hoped that I would get a parabola with Height = 160, Width = (distance between start and end point) 100. But no. I got a small curve that is about 20 pix height.

Please help me !


Knowledge: C, C++, C#, Java, Pawn


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>