在一次绘画事件中,我做了:
List<Point> drawPoints = GetDrawPoints();
if (drawPoints.Count > 1)
{
foreach (Point p in drawPoints)
{
e.Graphics.DrawLine(pen, p.X - 2, p.Y - 2, 4, 4);
}
}
但不是在后续点之间画线,而是从同一个地方到每个点画两条线。
我想用一条线连接所有点。
最佳答案
使用DrawLines并将列表作为数组传递:
if (drawPoints.Count > 1)
{
e.Graphics.DrawLines(pen, drawPoints.ToArray());
}
关于c# - 如何在所有绘制点之间画一条线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30255516/