绘制直线与平滑曲线示例
private void Form1_Paint(object sender,PaintEventArgs e)
{
Pen redPen = new Pen(Color.Red, 3);
Pen greenPen = new Pen(Color.Green, 3);
Point[] curvePoints =
{ new Point( 50, 250),new Point(100, 25),new Point(200, 250),
new Point(250, 50),new Point(300, 75),new Point(350, 200),
new Point(400, 150)};
e.Graphics.DrawLines(redPen, curvePoints);
e.Graphics.DrawCurve(greenPen, curvePoints); }
2021-11-10 11:11:58
357KB
C#
图形绘制
1