FMX.Objects.TImage.DrawBitmap
Delphi
procedure DrawBitmap(const Canvas: TCanvas; const ARect: TRectF; const ABitmap: TBitmap; const AOpacity: Single = 1.0);
C++
void __fastcall DrawBitmap(Fmx::Graphics::TCanvas* const Canvas, const System::Types::TRectF &ARect, Fmx::Graphics::TBitmap* const ABitmap, const float AOpacity = 1.000000E+00f);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FMX.Objects.pas FMX.Objects.hpp |
FMX.Objects | TImage |
Description
Draws a TBitmap image after scaling it to a specified area of the TCanvas.
Use this method to display a whole bitmap image into a specified area of the TCanvas. To display a specified area of the bitmap image, use the FMX.Graphics.TCanvas.DrawBitmap method.
Parameters
This method defines the following parameters:
Canvas
: specifies a canvas.ARect
: specifies the rectangle area ofCanvas
to be drawn.ABitmap
: specifies a TBitmap image.AOpacity
: specifies the transparency to be applied to theABitmap
.
Notes
When using the DrawBitmap method, pay attention to the following:
- When drawing a bitmap image, this method uses the following properties of TImage:
- FMX.Objects.TImage.BitmapMargins: Specifies the margins of the bitmap image to draw.
- FMX.Objects.TImage.WrapMode: Specifies whether and how to resize, replicate, and position the bitmap image.
- It is recommended to use this method within the onPaint event handlers, such as FMX.Controls.TControl.OnPaint or FMX.Forms.TCustomForm.OnPaint.