//声明: 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;
//效果图: