I draw some points over image based on some features, then i want to connect these points together with a line
List<Point> LinePoints = new List<Point>();
LinePoints.Add(p1);
LinePoints.Add(p2);
LinePoints.Add(p3);
and in the paint event:
Pen p = new Pen(Color.Blue);
if (LinePoints.Count > 1)
{
e.Graphics.DrawLines(p, LinePoints.ToArray());
}
In the first time line is drawn between points , but in the next iteration
i will add some other points to the list LinePoints
.
In this case the old drawn line is removed and the next one is drawn
but i don not want to remove the old lines.
How to draw line between all new points which are added to the list LinePoints
without remove the old lines ?
List<Point> LinePoints = new List<Point>();
? You probably will want to change to a List<List<Point>>, at least if your points are not all connected.. See here for an example - TaW