TIEBitmap.DrawToCanvasWithAlpha
TIEBitmap.DrawToCanvasWithAlpha
Declaration
procedure DrawToCanvasWithAlpha(DestCanvas: TCanvas; xDst, yDst : integer; Transparency: integer = 255; Opacity: double = 1.0);
Description
Draws the whole bitmap to the specified
DestCanvas canvas, at coordinates
xDst, yDst with parameters:
Transparency specifies the transparency value (0 to 255).
Opacity specifies the opacity (0 to 1.0).
This functions reads the destination canvas pixels and merges them with image using the alpha channel mask.
Note: This is a simplified version of
RenderToCanvasWithAlphaOpacity vs Transparency
Both the Opacity and Transparency parameters provide the same functionality. Transparency is the traditional ImageEn value, whereas Opacity provides easier PSD compatibility.
While they can be used in combination, generally only one will be used, i.e. leave Opacity=1 and make use of transparency, or alternatively, leave Transparency=255 and make use of Opacity. For example, for 50% opacity: Transparency = 255 and Opacity = 0.5, or Transparency = 128 and Opacity = 1.0
Example
iebmp.DrawToCanvasWithAlpha( PaintBox1.Canvas, 100, 100 );
See Also
-
RenderToCanvasWithAlpha-
DrawToCanvasTIEBitmap Assignment and Drawing Methods
TIEBitmap Methods Method | Mode | Purpose |
Assign | From TIEBitmap/TBitmap/TGraphic/TIcon | Copy whole image |
AssignImage | From TIEBitmap | Like assign, but does not copy the alpha channel |
AssignRect | From TIEBitmap/TBitmap | Copy a specified rect |
CopyAndConvertFormat | From TIEBitmap | Copy whole image |
CopyRectTo | To TIEBitmap | Copy rect to another image (without scaling) |
CopyWithMask1 | To TIEBitmap | Copy image using a mask to specify what is copied from the source |
CopyWithMask2 | To TIEBitmap | Copy image using a mask to specify what is replaced in the destintation |
DrawToTIEBitmap | To TIEBitmap | Copies all or part of the image to a specified position and/or size |
JoinBitmaps | From two TIEBitmaps | Draws two bitmaps to a single bitmaps |
MergeAlphaRectTo | With TIEBitmap | Merges all or part of two TIEBitmaps with alpha channels to a specified position using merge rules |
MergeWithAlpha | With TIEBitmap | Merges all or part of two TIEBitmaps with alpha channels to a specified position |
RenderToTIEBitmapEx | To TIEBitmap | Extended drawing of content to a TIEBitmap |
StretchRectTo | To TIEBitmap | Copy rect to dest rect in another image (with scaling) |
SwitchTo | To TIEBitmap | Move content from one TIEBitmap to another |
TBitmap MethodsTCanvas Methods