//聲明:
PolyPolygon(
DC: HDC; {設備環境句柄}
var Points; {點數組}
var nPoints;{數組, 數組元素是每個多邊形的頂點數}
p4: Integer {多邊形數, 也就是 nPoints 的元素數}
): BOOL;
//舉例:
procedure TForm1.FormPaint(Sender: TObject);
var
ps: array[0..9] of TPoint;
pn: array[0..1] of Integer;
begin
{多邊形1:}
ps[0].X := 50;
ps[0].Y := 50;
ps[1].X := 100;
ps[1].Y := 50;
ps[2].X := 125;
ps[2].Y := 75;
ps[3].X := 100;
ps[3].Y := 100;
ps[4].X := 50;
ps[4].Y := 100;
ps[5].X := 25;
ps[5].Y := 75;
{多邊形2:}
ps[6].X := 200;
ps[6].Y := 25;
ps[7].X := 300;
ps[7].Y := 25;
ps[8].X := 300;
ps[8].Y := 125;
ps[9].X := 200;
ps[9].Y := 125;
pn[0] := 6; {多邊形1有6個頂點}
pn[1] := 4; {多邊形2有4個頂點}
PolyPolygon(Canvas.Handle, ps, pn, 2);
end;
//效果圖: