Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_Polygons🞂PolygonFunction

Polygon

Rasterizes a single filled polygon shape onto a destination bitmap using floating-point or fixed-point coordinates with optional LCD sub-pixel antialiasing and custom fillers.

Declaration ​

pascal
procedure PolygonFS(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonFS(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; Filler: TCustomPolygonFiller; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonFS_LCD(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonFS_LCD2(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonFS(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; ClipRect: TRect; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonFS(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; ClipRect: TRect; Filler: TCustomPolygonFiller; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonFS_LCD(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; ClipRect: TRect; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonFS_LCD2(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; ClipRect: TRect; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;

procedure PolygonXS(Bitmap: TCustomBitmap32; const Points: TArrayOfFixedPoint; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonXS(Bitmap: TCustomBitmap32; const Points: TArrayOfFixedPoint; Filler: TCustomPolygonFiller; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil); overload;
procedure PolygonXS_LCD(Bitmap: TCustomBitmap32; const Points: TArrayOfFixedPoint; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil);
procedure PolygonXS_LCD2(Bitmap: TCustomBitmap32; const Points: TArrayOfFixedPoint; Color: TColor32; FillMode: TPolyFillMode = pfAlternate; Transformation: TTransformation = nil);

Parameters ​

ParameterTypeDescription
BitmapTCustomBitmap32Destination bitmap.
Points-Polygon vertices.
ColorTColor32Solid fill color.
FillerTCustomPolygonFillerCustom span filler.
ClipRectTRectOptional explicit clipping rectangle.
FillModeTPolyFillModePolygon fill rule (pfAlternate or pfWinding).
TransformationTTransformationOptional coordinate transformation.

Description ​

The Polygon routines rasterize a single closed polygon contour defined by Points onto a destination Bitmap.

Function variants support floating-point (FS) and fixed-point (XS) coordinate inputs, solid color or custom span filler rendering, optional explicit bounding box clipping (ClipRect), and sub-pixel LCD antialiasing (LCD and LCD2).

Variants ​

VariantCoordinate TypeAnti-AliasingDescription
PolygonFSFloating-pointStandard coverageRasterizes a floating-point polygon contour using standard antialiased coverage blending.
PolygonFS_LCDFloating-point3x LCD sub-pixelRasterizes a floating-point polygon contour using horizontal sub-pixel LCD rendering for sharp text and crisp vector outlines on LCD monitors.
PolygonFS_LCD2Floating-pointSoft LCD sub-pixelRasterizes a floating-point polygon contour using a soft sub-pixel LCD filtering profile.
PolygonXSFixed-pointStandard coverageRasterizes a fixed-point polygon contour using standard antialiased coverage blending.
PolygonXS_LCDFixed-point3x LCD sub-pixelRasterizes a fixed-point polygon contour using horizontal sub-pixel LCD rendering.
PolygonXS_LCD2Fixed-pointSoft LCD sub-pixelRasterizes a fixed-point polygon contour using a soft sub-pixel LCD filtering profile.

Example ​

pascal
var
  Pts: TArrayOfFloatPoint;
begin
  SetLength(Pts, 3);
  Pts[0] := FloatPoint(50.0, 10.0);
  Pts[1] := FloatPoint(90.0, 90.0);
  Pts[2] := FloatPoint(10.0, 90.0);

  // Render solid antialiased polygon
  PolygonFS(Bitmap, Pts, clRed32, pfAlternate);
end;

See also ​