如何画一条连续的曲线用Path 画一条连续的曲线.我想知道曲线每点的坐标怎么计算,有什么规律?有点代码最好

1个回答

  • private void Form1_Paint(object sender,System.Windows.Forms.PaintEventArgs e)

    {

    // Create an array of points for the curve in the second figure.

    Point[] points = {

    new Point(40,60),

    new Point(50,70),

    new Point(30,90)};

    GraphicsPath path = new GraphicsPath();

    path.StartFigure(); // Start the first figure.

    path.AddArc(175,50,50,50,0,-180);

    path.AddLine(100,0,250,20);

    // First figure is not closed.

    path.StartFigure(); // Start the second figure.

    path.AddLine(50,20,5,90);

    path.AddCurve(points,3);

    path.AddLine(50,150,150,180);

    path.CloseFigure(); // Second figure is closed.

    e.Graphics.DrawPath(new Pen(Color.FromArgb(255,255,0,0),2),path);

    }

    前边要加using System.Drawing.Drawing2D;

    这段程序包含一个由直线_曲线和形状创建的图形,自己领会一下吧