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).
| Parameter | Type | Description |
|---|---|---|
DstX, DstY | Integer | Top-left destination coordinate on this bitmap. |
Src | TCustomBitmap32 | Source 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).
| Parameter | Type | Description |
|---|---|---|
DstX, DstY | Integer | Top-left destination coordinate on this bitmap. |
SrcRect | TRect | Source sub-rectangle on the source bitmap. |
Src | TCustomBitmap32 | Source 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.
| Parameter | Type | Description |
|---|---|---|
DstRect | TRect | Target destination rectangle on this bitmap. |
SrcRect | TRect | Source sub-rectangle on the source bitmap. |
Src | TCustomBitmap32 | Source 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.
| Parameter | Type | Description |
|---|---|---|
DstRect | TRect | Destination rectangle on this bitmap. |
SrcRect | TRect | Source rectangle in the external GDI device context. |
hSrc | HDC | Handle 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));