貝爾賽爾樣條曲線

"p1

貝爾賽爾樣條曲線是使用GDI(Graphics DeviceInterface,圖像設備藉口)在窗體中繪製的一種曲線圖形。函式結構如下:Public void DrawBezier(Pen pen,Point p1,Point p2,Point p3,Point p4):Point表示點的坐標。
public void DrawBezier(Pen pen,PointF p1,PointF p2,PointF p3,PointF p4)。
public void DrawBezier(Pen pen,float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4)。
實例如下:
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = this.CreateGraphics();
Pen Mypen = new Pen(Color.Blue,2);
Point p1 = new Point(50,50);
Point p2 = new Point(70, 25);
Point p3 = new Point(100, 30);
Point p4 = new Point(120, 85);
g.DrawBezier(Mypen,p1,p2,p3,p4);
g.DrawBezier(Mypen,20,10,60,40,80,45,90,10);
}

熱門詞條

聯絡我們