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);
どんな助けでも大歓迎です!