【发布时间】:2013-07-20 20:31:49
【问题描述】:
我目前正在尝试为我的 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);
任何帮助将不胜感激!
【问题讨论】: