FillPoly(word,PointType[]) Method

A megadott vonaltípussal rajzol egy zárt poligont, majd kifesti.

Namespace: Graph
procedure FillPoly(const NumPoint: word; const PolyPoints: array of PointType);

Parameters

NumPoint
Type: word

A pontok száma.

PolyPoints
Type: array of PointType

A pontokat tartalmazó PointType típusú tömb.

Egy n pontból álló zárt alakzat rajzolásához, n+1 elemű tömböt kell felvenni, ahol az első és utolsó pont meg kell hogy egyezzen.

procedure Triangle; //draws a triangle, centered at (100, 100)
var
  Points: array [0..3] of PointType;
begin
  Points[0].X := 50;
  Points[0].Y := 150;
   Points[1].X := 100;
  Points[1].Y := 50;
   Points[2].X := 150;
  Points[2].Y := 150;
   Points[3] := Points[0];
  FillPoly(4, Points);
end;
 

Reference