[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Graphics' (#lcl)

TCanvas.Polygon

Polygon draws a closed, many-sided shape on the canvas, using the value of Pen

Declaration

Source position: line 0

public procedure TCanvas.Polygon(

  const Points: array of TPoint;

  Winding: Boolean;

  StartIndex: Integer = 0;

  NumPts: Integer = -1

);

procedure TCanvas.Polygon(

  Points: PPoint;

  NumPts: Integer;

  Winding: Boolean = false

); virtual;

procedure TCanvas.Polygon(

  const Points: array of TPoint

);

Description

Method: TCanvas.Polygon
Params: Points: array of TPoint; Winding: Boolean = False; StartIndex: Integer = 0; NumPts: Integer = -1
Returns: Nothing

Use Polygon to draw a closed, many-sided shape on the canvas, using the value of Pen . After drawing the complete shape, Polygon fills the shape using the value of Brush .

The Points parameter is an array of points that give the vertices of the polygon.
Winding determines how the polygon is filled. When Winding is True, Polygon fills the shape using the Winding fill algorithm.
When Winding is False, Polygon uses the even-odd (alternative) fill algorithm.
StartIndex gives the index of the first point in the array to use. All points before this are ignored.
NumPts indicates the number of points to use, starting at StartIndex .
If NumPts is -1 (the default), Polygon uses all points from StartIndex to the end of the array.
The first point is always connected to the last point.
To draw a polygon on the canvas, without filling it, use the Polyline method, specifying the first point a second time at the end.

See also

TCanvas.PolyLine

  

Polyline connects a set of points on the canvas

The latest version of this document can be found at lazarus-ccr.sourceforge.net.