Sign in Join
FPDoc Onlineexperiment

TCanvas.BrushCopy procedure

Member of TCanvaspublicIn unit Graphics

Copies part of a bitmap to a rectangle on the canvas and replaces the transparent color with the canvas Brush color.

Declaration

pascal
procedure BrushCopy(ADestRect: TRect; ABitmap: TBitmap; 
 ASourceRect: TRect; ATransparentColor: TColor)
 ; virtual

Arguments

ADestRect

Rectangle on the canvas where the content from ABitmap is stored.

ABitmap

TBitmap with the pixel content copied in the method.

ASourceRect

Rectangle with the bounds for the copied region in ABitmap.

ATransparentColor

Specifies the pixel color in ABitmap which becomes transparent when copied to the destination rectangle on the Canvas.

Description

The end result is that pixels copied from ABitmap using the color in ATransparentColor are replaced with the brush color for the canvas. This makes the copied area in ASourceRect partially transparent when applied to ADestRect.

Pixels colors from ASourceRect are applied to a temporary image, and the StretchDraw method is called to draw the copied rectangle onto the canvas.

Set the Color property in Brush before calling the method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.