Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32🞂TBitmap32🞂DrawMethodPublic

TBitmap32.Draw

Draws a source bitmap, sub-rectangle, or GDI device context (HDC) onto this bitmap using current DrawMode and CombineMode.

Declarations ​

pascal
procedure Draw(DstX, DstY: Integer; Src: TCustomBitmap32); overload;
procedure Draw(DstX, DstY: Integer; const SrcRect: TRect; Src: TCustomBitmap32); overload;
procedure Draw(const DstRect, SrcRect: TRect; Src: TCustomBitmap32); overload;
procedure Draw(const DstRect, SrcRect: TRect; hSrc: HDC); overload;
Overload Details

Overload 1 ​

pascal
procedure Draw(DstX, DstY: Integer; Src: TCustomBitmap32); overload;

Draws the entire source bitmap at top-left pixel position (DstX, DstY).

ParameterTypeDescription
DstX, DstYIntegerTop-left destination coordinate on this bitmap.
SrcTCustomBitmap32Source bitmap to draw.

Overload 2 ​

pascal
procedure Draw(DstX, DstY: Integer; const SrcRect: TRect; Src: TCustomBitmap32); overload;

Draws a sub-rectangle from the source bitmap at top-left pixel position (DstX, DstY).

ParameterTypeDescription
DstX, DstYIntegerTop-left destination coordinate on this bitmap.
SrcRectTRectSource sub-rectangle on the source bitmap.
SrcTCustomBitmap32Source bitmap to copy or blend pixels from.

Overload 3 ​

pascal
procedure Draw(const DstRect, SrcRect: TRect; Src: TCustomBitmap32); overload;

Stretches and blends a sub-rectangle from the source bitmap into a destination rectangle.

ParameterTypeDescription
DstRectTRectTarget destination rectangle on this bitmap.
SrcRectTRectSource sub-rectangle on the source bitmap.
SrcTCustomBitmap32Source bitmap to copy or blend pixels from.

Overload 4 ​

pascal
procedure Draw(const DstRect, SrcRect: TRect; hSrc: HDC); overload;

Copies a sub-rectangle from an external GDI device context (HDC) into a destination rectangle on this bitmap.

ParameterTypeDescription
DstRectTRectDestination rectangle on this bitmap.
SrcRectTRectSource rectangle in the external GDI device context.
hSrcHDCHandle to the source GDI device context.

Description ​

Draw blits pixel data onto this bitmap. In addition to standard bitmap-to-bitmap blitting, TBitmap32 provides an overload to copy pixels directly from an external GDI device context handle (hSrc).

Example ​

pascal
// Copy screen area directly from Windows desktop DC
Bitmap.Draw(Bitmap.BoundsRect, Rect(0, 0, 100, 100), GetDC(0));