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

TWidgetSet.Polygon

Draws a filled Polygon.

Declaration

Source position: winapih.inc line 213

public function TWidgetSet.Polygon(

  DC: HDC;

  Points: PPoint;

  NumPts: Integer;

  Winding: Boolean

):Boolean; virtual;

Arguments

DC

  

The device context.

Points

  

The array of vertices.

NumPts

  

The number of vertices.

Winding

  

Selects the fill algorithm.

Function result

False on failure.

Description

Use Polygon to draw a closed, many-sided shape on the canvas, outlined with the current Pen and filled with the current Brush.

The Points parameter is an array of 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.

The first point is always connected to the last point.

To draw an unfilled polygon use the Polyline method, specifying the first point a second time at the end.


Version 4.0 Generated 2025-05-03 Home