//聲明:
PolyBezIEr(
DC: HDC; {設備環境句柄}
const Points; {點數組}
Count: DWord {數組元素個數}
): BOOL;
//一條貝塞爾線最少要有 4 個點
procedure TForm1.FormPaint(Sender: TObject);
var
ps: array[0..3] of TPoint;
begin
ps[0].X := 10;
ps[0].Y := 50;
ps[1].X := 40;
ps[1].Y := 90;
ps[2].X := 80;
ps[2].Y := 10;
ps[3].X := 110;
ps[3].Y := 50;
PolyBezIEr(Canvas.Handle, ps, 4);
Ellipse(Canvas.Handle, ps[0].X, ps[0].Y, ps[0].X+4, ps[0].Y+4);
Ellipse(Canvas.Handle, ps[1].X, ps[1].Y, ps[1].X+4, ps[1].Y+4);
Ellipse(Canvas.Handle, ps[2].X, ps[2].Y, ps[2].X+4, ps[2].Y+4);
Ellipse(Canvas.Handle, ps[3].X, ps[3].Y, ps[3].X+4, ps[3].Y+4);
end;
//效果圖:
//連續的貝塞爾線會把前一個終止點當作起始點
procedure TForm1.FormPaint(Sender: TObject);
var
ps: array[0..6] of TPoint;
begin
ps[0].X := 10;
ps[0].Y := 50;
ps[1].X := 40;
ps[1].Y := 90;
ps[2].X := 80;
ps[2].Y := 10;
ps[3].X := 110;
ps[3].Y := 50;
ps[4].X := 140;
ps[4].Y := 10;
ps[5].X := 180;
ps[5].Y := 90;
ps[6].X := 210;
ps[6].Y := 50;
PolyBezIEr(Canvas.Handle, ps, 7);
end;
//效果圖: