获得"论证异常"绘制曲线时

时间:2014-11-26 10:32:18

标签: c# system.drawing

当我尝试在C#windows窗体应用程序中绘制曲线时,我得到了参数异常。例外是“参数无效”。

Point point1 = new Point(37, 28);
Point point2 = new Point(30, 40);
Point point3 = new Point(23, 35);
Point point4 = new Point(30, 30);
Point point5 = new Point(40, 35);
Point point6 = new Point(40, 40);
Point point7 = new Point(39, 42);
Point[] curvePoints = { point1, point2, point3, point4, point5, point6, point7 };

//e.Graphics.DrawCurve(blackpen, curvePoints);
//Thread.Sleep(10);

Point[] curve = {}; 
for (nI = 0; nI < 7; nI++)
{
    curve = new Point[nI + 1];
    curve[nI] = curvePoints[nI];
    e.Graphics.DrawCurve(blackpen, curve);
    Thread.Sleep(50);
}
g.Dispose();

如何正确写作??

0 个答案:

没有答案