我目前正在尝试BezierSegment
为我的 WPF 添加一个到我的画布。我收到了不正确转换的编译时错误:
参数 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);
任何帮助将不胜感激!