Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32🞂TCustomBitmap32Class

TCustomBitmap32

Abstract base class for 32-bit ARGB pixel bitmaps in Graphics32, defining backend surface management, sub-pixel sampling, drawing primitives, and resampling.

Inheritance:TObject 🞂 TPersistent 🞂 TPlainInterfacedPersistent 🞂 TNotifiablePersistent 🞂 TThreadPersistent 🞂 TCustomMap 🞂 TCustomBitmap32

Declaration ​

pascal
type
  TCustomBitmap32 = class(TCustomMap)
    ...
  TCustomBitmap32Class = class of TCustomBitmap32;

Description ​

TCustomBitmap32 is the primary 2D image data container in Graphics32. It extends TCustomMap with 32-bit ARGB pixel buffer management, hardware-abstracted rendering backends (TCustomBackend), spatial clipping (ClipRect), drawing modes (DrawMode, CombineMode), alpha blending (MasterAlpha), and customizable pixel resamplers (TCustomResampler).

Pixel elements are represented as 32-bit ARGB colors (TColor32). TCustomBitmap32 provides extensive accessor methods for reading and writing pixels at integer, fixed-point (TFixed), or single-precision floating-point (TFloat) sub-pixel coordinates.

Derived Class: TBitmap32

Constructors ​

NameDescription
CreateInitializes a new TCustomBitmap32 instance with default or custom backend and dimensions.

Methods ​

General & Lifecycle ​

NameDescription
AssignCopies pixel buffer and properties from another persistent object or bitmap.
BeginMeasuringBegins area change measurement and bounding box calculation.
BoundsRectReturns a TRect representing the bitmap dimensions (0, 0, Width, Height).
ChangedTriggers update notifications for the entire bitmap or a specified sub-rectangle.
ClearClears the bitmap pixel buffer to zero (clNone32) or a specified TColor32 fill color.
CopyMapToCopies raw map dimensions and pixel data to a target TCustomBitmap32.
DeleteResets bitmap dimensions to zero and releases buffer memory.
EmptyReturns True if the bitmap has zero width or height.
EndMeasuringConcludes area change measurement.
GetPlatformBackendClassClass method returning the default platform backend class.
PropertyChangedNotifies the bitmap and backend that a property has changed.
ReleaseBackendDetaches and returns the active backend instance without destroying it.
ResetClipRectResets ClipRect to cover the full bitmap bounds (0, 0, Width, Height).

Stream & File I/O ​

NameDescription
LoadFromFileLoads bitmap data from a file on disk.
LoadFromResourceIDLoads bitmap data from an embedded resource by integer ID.
LoadFromResourceNameLoads bitmap data from an embedded resource by string name.
LoadFromStreamLoads bitmap data from a stream.
SaveToFileSaves bitmap data to a file on disk in BMP/DIB format.
SaveToStreamSaves bitmap data to a stream in BMP/DIB format.

Blitting & Alpha Operations ​

NameDescription
DrawDraws a source bitmap or sub-rectangle onto this bitmap.
DrawToDraws this bitmap or a sub-rectangle onto a target destination bitmap.
ResetAlphaResets alpha values of all pixels to $FF (opaque) or a specified alpha component.
SetPixelTSets a pixel with alpha blending (DrawMode / CombineMode).
SetPixelTSSets a pixel with alpha blending and boundary clipping.

Lines & Drawing Primitives ​

NameDescription
HorzLineDraws fast horizontal 1-pixel wide lines across integer or fixed-point coordinates with optional boundary clipping, alpha blending, and stippling.
VertLineDraws fast vertical 1-pixel wide lines across integer or fixed-point coordinates with optional boundary clipping, alpha blending, and stippling.
LineDraws 1-pixel wide line segments between specified coordinates using integer, fixed-point, or floating-point positioning with optional clipping, blending, anti-aliasing, and stippling.
MoveToSets current pen position for subsequent LineTo drawing operations using integer, fixed-point, or floating-point coordinates.
LineToDraws 1-pixel wide line segments from current pen position to target coordinates using integer, fixed-point, or floating-point positioning, updating pen position afterwards.

Rectangles & Shapes ​

NameDescription
FillRectFills a rectangular area with a specified 32-bit ARGB color using integer coordinates or TRect bounds, supporting optional boundary clipping and alpha blending.
FrameRectDraws 1-pixel wide rectangular outline frames around specified coordinates or TRect bounds with optional clipping, alpha blending, and stippling.
RaiseRectTSDraws a 3D bevelled button/panel edge.

Transformations ​

NameDescription
RollScrolls/shifts pixel contents horizontally and vertically with optional background fill.
FlipHorzFlips pixel contents horizontally (left to right).
FlipVertFlips pixel contents vertically (top to bottom).
Rotate90Rotates bitmap contents 90 degrees clockwise.
Rotate180Rotates bitmap contents 180 degrees.
Rotate270Rotates bitmap contents 270 degrees clockwise (90 degrees counter-clockwise).

Stipple Methods ​

NameDescription
SetStippleSets custom stipple color array pattern.
AdvanceStippleCounterAdvances stipple counter position by specified distance in pixels.
GetStippleColorEvaluates and returns current stipple color.

Properties ​

Pixel Accessors ​

NameTypeScopeDescription
PixelTColor32PublicIndexed pixel access properties for reading and writing 32-bit ARGB pixel values across integer, fixed-point, and floating-point coordinates.

Pen & Stipple Properties ​

NameTypeScopeDescription
PenColorTColor32PublicColor used for pen drawing operations (MoveTo, LineTo).
PenPosTPointPublicCurrent integer pen coordinate position.
PenPosFTFixedPointPublicCurrent fixed-point pen coordinate position.
StippleCounterSinglePublicCurrent phase position index along stipple pattern array.
StippleStepSinglePublicStep distance increment for stipple pattern evaluation.

Buffer & Backend Properties ​

NameTypeScopeDescription
BackendTCustomBackendPublicActive rendering surface backend instance.
BitsPColor32ArrayPublicPointer to contiguous raw 32-bit ARGB pixel memory buffer.
ClipRectTRectPublicClipping rectangle restricting pixel modifications.
ClippingBooleanPublicRead-only flag indicating if ClipRect active region is smaller than full bitmap dimensions.
MeasuringModeBooleanPublicIndicates whether area change measurement is active.
PixelPtrPColor32PublicPointer to specific pixel at integer coordinates [X, Y].
ScanLinePColor32ArrayPublicPointer to starting pixel memory location for scanline row [Y].

Drawing Modes & Resampling ​

NameTypeScopeDescription
CombineModeTCombineModePublishedPixel combination mode (cmBlend, cmMerge).
DrawModeTDrawModePublishedDraw mode (dmOpaque, dmBlend, dmCustom).
MasterAlphaCardinalPublishedGlobal alpha scaling factor (0 to 255) applied to draw operations.
OuterColorTColor32PublishedColor returned when sampling outside bitmap bounds in safe/transparent mode.
ResamplerTCustomResamplerPublishedActive resampler engine instance for sub-pixel stretching and sampling.
ResamplerClassNamestringPublishedClass name string of current resampler engine.
WrapModeTWrapModePublishedBoundary wrapping mode (wmClamp, wmRepeat, wmMirror).

Events ​

NameTypeDescription
OnAreaChangedTAreaChangedEventFired when a specific sub-rectangle region of pixel memory is updated.
OnPixelCombineTPixelCombineEventCustom pixel combination callback event when DrawMode = dmCustom.