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

TCustomBitmap32.HorzLine

Draws fast horizontal 1-pixel wide lines across integer or fixed-point coordinates with optional boundary clipping, alpha blending, and stippling.

Declaration ​

pascal
procedure HorzLine(X1, Y, X2: Integer; Value: TColor32);
procedure HorzLineS(X1, Y, X2: Integer; Value: TColor32);
procedure HorzLineT(X1, Y, X2: Integer; Value: TColor32);
procedure HorzLineTS(X1, Y, X2: Integer; Value: TColor32);
procedure HorzLineTSP(X1, Y, X2: Integer);
procedure HorzLineX(X1, Y, X2: TFixed; Value: TColor32);
procedure HorzLineXS(X1, Y, X2: TFixed; Value: TColor32);

Parameters ​

ParameterTypeDescription
X1, Y, X2IntegerStart X, Y row, and end X coordinates.
ValueTColor3232-bit ARGB color.

Description ​

The HorzLine methods draw fast 1-pixel wide horizontal lines between horizontal coordinates X1 and X2 at row Y. Because horizontal lines align directly with bitmap row scanlines in memory, these methods offer superior performance compared to general line drawing routines.

Method variants support integer (Integer) or 16.16 fixed-point (TFixed) coordinates, boundary clipping (S), alpha blending (T), and pattern stippling (P).

Variants ​

VariantCoordinate TypeModifiersDescription
HorzLineIntegerDirectFast direct horizontal line fill without boundary clipping or alpha blending.
HorzLineSIntegerSafeHorizontal line fill clipped against ClipRect.
HorzLineTIntegerTransparentUnclipped horizontal line fill with alpha blending using DrawMode / CombineMode.
HorzLineTSIntegerTransparent + SafeClipped horizontal line fill with alpha blending using DrawMode / CombineMode.
HorzLineTSPIntegerTransparent + Safe + StippleClipped alpha-blended horizontal line using active stipple pattern.
HorzLineXTFixedFixed Sub-pixelUnclipped 16.16 fixed-point horizontal line with anti-aliasing.
HorzLineXSTFixedFixed Sub-pixel + SafeClipped 16.16 fixed-point horizontal line with anti-aliasing.

Example ​

pascal
// Fast direct horizontal line
Bitmap.HorzLine(10, 50, 200, clRed32);

// Clipped alpha-blended horizontal line
Bitmap.HorzLineTS(0, 75, 300, clTrGreen32);

See also ​