i have been trying to draw arrows using coding behind approach and path function . however it
is giving me error . i am inserting the code here
Path orangePath = new Path();
PathFigure pathFigure = new PathFigure();
pathFigure.StartPoint = new Point(0,0);
// drawing stratight line
LineSegment lineSegment1 = new LineSegment();
lineSegment1.Point = new Point(10,0);
pathFigure.Segments.Add(lineSegment1);
//drawing top half of arrow
LineSegment lineSegment2 = new LineSegment();
lineSegment2.Point = new Point(5,-5);
pathFigure.Segments.Add(lineSegment2);
//coming back to the same position . its here where ERROR is happening .instead of coming back to the arrowhead it is adding to it .
LineSegment lineSegment3 = new LineSegment();
lineSegment3.Point = new Point(10,0);
pathFigure.Segments.Add(lineSegment3);
// drawing the bottom half of the arrow
LineSegment lineSegment4 = new LineSegment();
lineSegment4.Point = new Point(5,5);
pathFigure.Segments.Add(lineSegment4);
PathGeometry pathGeometry = new PathGeometry();
pathGeometry.Figures = new PathFigureCollection();
pathGeometry.Figures.Add(pathFigure);
orangePath.Data = pathGeometry;
orangePath.Stroke = System.Windows.Media.Brushes.Black;
orangePath.StrokeThickness=2;
orangePath.Margin = new Thickness(20, 20, 20, 20);
grid1.Children.Add(orangePath);
1. what is the error here ? is there any third party dll to help the situation ?
arka Bhattacharya