private void CreateQuadraticBezierSegment()
{
PathFigure pthFigure = new PathFigure();
pthFigure.StartPoint = new Point(10, 100);
QuadraticBezierSegment qbzSeg = new QuadraticBezierSegment();
qbzSeg.Point1 = new Point(50, 200);
qbzSeg.Point2 = new Point(200, 50);
PathSegmentCollection myPathSegmentCollection = new PathSegmentCollection();
myPathSegmentCollection.Add(qbzSeg);
pthFigure.Segments = myPathSegmentCollection;
PathFigureCollection pthFigureCollection = new PathFigureCollection();
pthFigureCollection.Add(pthFigure);
PathGeometry pthGeometry = new PathGeometry();
pthGeometry.Figures = pthFigureCollection;
Path arcPath = new Path();
arcPath.Stroke = new SolidColorBrush(Colors.Black);
arcPath.StrokeThickness = 1;
arcPath.Data = pthGeometry;
arcPath.Fill = new SolidColorBrush(Colors.Yellow);
LayoutRoot.Children.Add(arcPath);
} |