[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Graphics' (#lcl)

TCanvas.BrushCopy

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

Declaration

Source position: graphics.pp line 1111

public procedure TCanvas.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

TCanvas.Brush

  

The Brush used to paint on the Canvas.

TCanvas.StretchDraw

  

Expands or contracts the specific graphic content to fit the specified destination rectangle on the canvas.

TBrush.Color

  

The Color of the current Brush.

TColorToFPColor

  

TColorToFPColor - converts a color of type TColor to one specified as a FPColor.

TBitmap

  

Implements a FCL-compatible reader/writer for a Bitmap image.


Version 3.2 Generated 2024-02-25 Home