Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32🞂TCustomBitmap32🞂LineMethodPublic

TCustomBitmap32.Line

Draws 1-pixel wide line segments between specified coordinates using integer, fixed-point, or floating-point positioning with optional clipping, alpha blending, anti-aliasing, and stippling.

Declaration ​

pascal
procedure Line(X1, Y1, X2, Y2: Integer; Value: TColor32; L: Boolean = False);
procedure LineS(X1, Y1, X2, Y2: Integer; Value: TColor32; L: Boolean = False);
procedure LineT(X1, Y1, X2, Y2: Integer; Value: TColor32; L: Boolean = False);
procedure LineTS(X1, Y1, X2, Y2: Integer; Value: TColor32; L: Boolean = False);
procedure LineA(X1, Y1, X2, Y2: Integer; Value: TColor32; L: Boolean = False);
procedure LineAS(X1, Y1, X2, Y2: Integer; Value: TColor32; L: Boolean = False);
procedure LineX(X1, Y1, X2, Y2: TFixed; Value: TColor32; L: Boolean = False); overload;
procedure LineXS(X1, Y1, X2, Y2: TFixed; Value: TColor32; L: Boolean = False); overload;
procedure LineF(X1, Y1, X2, Y2: Single; Value: TColor32; L: Boolean = False); overload;
procedure LineFS(X1, Y1, X2, Y2: Single; Value: TColor32; L: Boolean = False); overload;
procedure LineXP(X1, Y1, X2, Y2: TFixed; L: Boolean = False); overload;
procedure LineXSP(X1, Y1, X2, Y2: TFixed; L: Boolean = False); overload;
procedure LineFP(X1, Y1, X2, Y2: Single; L: Boolean = False); overload;
procedure LineFSP(X1, Y1, X2, Y2: Single; L: Boolean = False); overload;

Parameters ​

ParameterTypeDescription
X1, Y1, X2, Y2-Start and end pixel coordinates.
ValueTColor3232-bit ARGB color.
LBooleanIf True, includes the last pixel.

Description ​

The Line methods draw 1-pixel wide straight line segments between starting coordinates (X1, Y1) and ending coordinates (X2, Y2). Method variants provide specific combinations of coordinate types (Integer, TFixed, Single), boundary clipping (S), alpha transparency (T), anti-aliasing (A, X, F), and pattern stippling (P).

When parameter L (Last pixel) is True, the final end pixel (X2, Y2) is rendered; when False, the endpoint pixel is omitted (useful for drawing contiguous polyline segments without double-rendering vertices).

Variants ​

VariantCoordinate TypeModifiersDescription
LineIntegerDirectFast integer line rendering without clipping or blending.
LineSIntegerSafeInteger line rendering clipped against ClipRect.
LineTIntegerTransparentUnclipped integer line rendering with alpha blending.
LineTSIntegerTransparent + SafeClipped integer line rendering with alpha blending.
LineAIntegerAnti-aliasedUnclipped anti-aliased integer line rendering using Wu's algorithm.
LineASIntegerAnti-aliased + SafeClipped anti-aliased integer line rendering using Wu's algorithm.
LineXTFixedFixed Sub-pixelUnclipped 16.16 fixed-point anti-aliased line rendering.
LineXSTFixedFixed Sub-pixel + SafeClipped 16.16 fixed-point anti-aliased line rendering.
LineFSingleFloat Sub-pixelUnclipped floating-point anti-aliased line rendering.
LineFSSingleFloat Sub-pixel + SafeClipped floating-point anti-aliased line rendering.
LineXPTFixedFixed + StippleUnclipped 16.16 fixed-point stippled line rendering using active stipple pattern.
LineXSPTFixedFixed + Stipple + SafeClipped 16.16 fixed-point stippled line rendering using active stipple pattern.
LineFPSingleFloat + StippleUnclipped floating-point stippled line rendering using active stipple pattern.
LineFSPSingleFloat + Stipple + SafeClipped floating-point stippled line rendering using active stipple pattern.

Example ​

pascal
// Direct integer line
Bitmap.Line(0, 0, 100, 100, clRed32);

// Clipped anti-aliased floating-point line
Bitmap.LineFS(10.5, 10.5, 200.25, 150.75, clBlue32);

See also ​