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

Polyline

Renders a single stroked polyline contour with configurable join styles, cap styles, stroke widths, and span fillers onto a destination bitmap.

Declaration ​

pascal
procedure PolylineFS(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; Color: TColor32; Closed: Boolean = False; StrokeWidth: TFloat = 1.0; JoinStyle: TJoinStyle = jsMiter; EndStyle: TEndStyle = esButt; MiterLimit: TFloat = 4.0; Transformation: TTransformation = nil); overload;
procedure PolylineFS(Bitmap: TCustomBitmap32; const Points: TArrayOfFloatPoint; Filler: TCustomPolygonFiller; Closed: Boolean = False; StrokeWidth: TFloat = 1.0; JoinStyle: TJoinStyle = jsMiter; EndStyle: TEndStyle = esButt; MiterLimit: TFloat = 4.0; Transformation: TTransformation = nil); overload;

procedure PolylineXS(Bitmap: TCustomBitmap32; const Points: TArrayOfFixedPoint; Color: TColor32; Closed: Boolean = False; StrokeWidth: TFixed = $10000; JoinStyle: TJoinStyle = jsMiter; EndStyle: TEndStyle = esButt; MiterLimit: TFixed = $40000; Transformation: TTransformation = nil); overload;
procedure PolylineXS(Bitmap: TCustomBitmap32; const Points: TArrayOfFixedPoint; Filler: TCustomPolygonFiller; Closed: Boolean = False; StrokeWidth: TFixed = $10000; JoinStyle: TJoinStyle = jsMiter; EndStyle: TEndStyle = esButt; MiterLimit: TFixed = $40000; Transformation: TTransformation = nil); overload;

Parameters ​

ParameterTypeDescription
BitmapTCustomBitmap32Destination bitmap.
Points-Polyline vertices.
ColorTColor32Solid stroke color.
FillerTCustomPolygonFillerCustom span filler.
ClosedBooleanSpecifies whether the polyline forms a closed loop.
StrokeWidth-Stroke line width.
JoinStyleTJoinStyleCorner join style (jsMiter, jsBevel, jsRound).
EndStyleTEndStyleLine end cap style (esButt, esSquare, esRound).
MiterLimit-Miter limit ratio before beveling sharp miter joins.
TransformationTTransformationOptional coordinate transformation.

Description ​

The Polyline routines render a single stroked polyline contour defined by Points onto a destination Bitmap.

Function variants support floating-point (FS) and fixed-point (XS) coordinate inputs as well as solid color or custom span filler rendering. Stroke outlines are generated automatically according to StrokeWidth, JoinStyle, EndStyle, and MiterLimit.

Variants ​

VariantCoordinate TypeDescription
PolylineFSFloating-pointRenders a single floating-point polyline contour with antialiased stroke outlines.
PolylineXSFixed-pointRenders a single fixed-point polyline contour with antialiased stroke outlines.

Example ​

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

  // Render open polyline with 3.0px width and round caps/joins
  PolylineFS(Bitmap, Pts, clBlack32, False, 3.0, jsRound, esRound);
end;

See also ​