我目前正在尝试为我的WPF应用程序添加一个BezierSegment到画布中。我得到一个编译时错误,指出无法进行不正确的转换:
任何帮助都将不胜感激!
参数1:无法将“System.Windows.Media.PathGeometry”转换为“System.Windows.UIElement”
这是我目前的代码:
//bezier curve it
BezierSegment curve = new BezierSegment(startPoint, endPoint,controlPoint,false);
// Set up the Path to insert the segments
PathGeometry path = new PathGeometry();
PathFigure pathFigure = new PathFigure();
pathFigure.StartPoint = hs.LeStartingPoint;
pathFigure.IsClosed = true;
path.Figures.Add(pathFigure);
pathFigure.Segments.Add(curve);
System.Windows.Shapes.Path p = new Path();
p.Data = path;
this.mainWindow.MyCanvas.Children.Add(path);
任何帮助都将不胜感激!