Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomCanvas.DrawBitmap(TdxGpFastDIB,TRect,TRect,TAlphaFormat,PcxCanvasBasedImage) Method

Draws a specified bitmap on the canvas.

#Declaration

Delphi
procedure DrawBitmap(ABitmap: TdxGpFastDIB; const ATargetRect: TRect; const ASourceRect: TRect; AAlphaFormat: TAlphaFormat; ACache: PcxCanvasBasedImage = nil); overload; virtual;

#Parameters

Name Type
ABitmap TdxGpFastDIB
ATargetRect TRect
ASourceRect TRect
AAlphaFormat TAlphaFormat
ACache PcxCanvasBasedImage

#Remarks

Call any of the eight overloaded DrawBitmap procedure variants to draw a bitmap from a specified source on the canvas. The following table lists all overloaded variants and their parameters breakdown:

Overloaded Variant

Description

1

This procedure variant accepts a TBitmap container and a target rectangle on the canvas as the ABitmap and ATargetRect parameters, respectively.

2

This procedure variant accepts a TBitmap container (ABitmap), a target rectangle on the canvas (ATargetRect), and a reserved byte interpretation mode (AAlphaFormat). All overloaded DrawBitamp procedure variants work identically in all reserved byte interpretation modes. Pass the corresponding value as the last parameter to:

  • Ignore reserved bytes (afIgnored).

  • Treat all TRGBQuad values in the source bitmap as RGBA values (afDefined).

  • Load reserved bytes as alpha values and treat red, green, and blue values as pre-multiplied by the corresponding alpha values (afPremultiplied).

3

This procedure variant works similarly to the first variant. In addition, the third variant accepts a rectangle on the source bitmap (ASourceRect) to allow you to draw a rectangular portion of the bitmap.

4

This procedure variant works similarly to the second variant. Like the third variant, the second variant accepts a rectangle on the source bitmap as the ASourceRect parameter.

5

This procedure variant accepts a memory DC-based DIB image buffer as the image source (ABitmap), a target rectangle on the canvas (ATargetRect) and a reserved byte interpretation mode (AAlphaFormat).

6

This procedure variant works similarly to the fifth variant. In addition, the sixth variant accepts a source rectangle as the ASourceRect parameter to allow you to draw a rectangular portion of the source image buffer.

7

This procedure variant accepts a GDI+ API-based DIB image buffer as the image source (ABitmap), a target rectangle on the canvas (ATargetRect) and a reserved byte interpretation mode (AAlphaFormat).

8

This procedure variant works similarly to the seventh variant. In addition, the eighth variant accepts a source rectangle as the ASourceRect parameter to allow you to draw a rectangular portion of the source image buffer.

Note

The ACache optional parameter is not intended for use in your code. Only the internal Direct2D-based draw routines use this parameter.

See Also