Sign in Join
FPDoc Onlineexperiment

TLazCanvas.AlphaBlend procedure

Member of TLazCanvaspublicIn unit LazCanvas

Alpha blends the specified content from the source canvas onto the canvas instance.

Declaration

pascal
procedure AlphaBlend(ASource: TLazCanvas; const ADestX: Integer; 
 const ADestY: Integer; const ASourceX: Integer; 
 const ASourceY: Integer; 
 const ASourceWidth: Integer; 
 const ASourceHeight: Integer)

Arguments

ASource

Lazarus canvas with the content alpha blended onto the current class instance.

ADestX

Left coordinate where the content in ASource is applied.

ADestY

Top coordinate where the content in ASource is applied.

ASourceX

Left coordinate for the content in ASource applied in the method.

ASourceY

Top coordinate for the content in ASource applied in the method.

ASourceWidth

Width (in pixels) of the content in ASource applied in the method.

ASourceHeight

Height (in pixels) of the content in ASource applied in the method.

Description

AlphaBlend combines the content in ASource with the current class instance to create the appearance of an image with partial or full transparency. The current class instance provides the background for the combined content.

ADestX and ADestY provides the left and top coordinates where the content from ASource is overlayed.

ASourceX, ASourceY, ASourceWidth and ASourceHeight contain the coordinates and dimensions for the image area retrieved from the ASource canvas.

AlphaBlend ensures that the specified source content is not too large for the destination area. The dimensions in ASourceWidth and ASourceHeight are adjusted if any part of the image is outside the destination area.

AlphaBlend creates an inverse mask for the alpha channel used on the pixels in ASource. The mask is applied to the RGB components for the Colors in the current class instance. The alpha channel in Colors is set to alphaOpaque for the combined content.

AlphaBlend is used in the implementation of the AlphaBlend_Image method.

Topics of Interest (but not documented in FCL)

  • TFPCustomCanvas.Colors (in fpcanvas.pp)
  • TFPImageCanvas (in fpimgcanv.pp)
  • TFPColor (in fpimage.pp)

See also

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