ImageEn, unit iexBitmaps

TIEBitmap.AssignTo

TIEBitmap.AssignTo


Declaration

procedure AssignTo(Dest: TObject; MaxW: Integer = 0; MaxH: Integer = 0; Filter: TResampleFilter = rfNone); overload;
procedure AssignTo(Dest: TObject; Scale: Double; Filter: TResampleFilter); overload;


Description

Copies the image to the Dest, which can be a TBitmap, TImage, TPicture or TIEBitmap object.
The image can optionally scaled to MaxW x MaxH using the specified resample filter. These values will be automatically reduced to maintain the aspect ratio. If the image is smaller than this size, it is not upscaled.
For TBitmap: The Alpha channel is ignored. If you require Alpha support, use CopyToTBitmap. The output pixel format will be pf24bit if scaled, otherwise converted as follows:
ie1g -> pf1bit
ie8p -> pf8bit
ie8g -> pf8bit (create gray scale palette)
ie16g -> pf8bit (copy only high 8 bit)
ie24RGB* -> pf24bit
ie32RGB -> pf32bit

For TIEBitmap: The alpha channel will be copied to the destination object. The output pixel format will be ie24RGB if scaled, otherwise it will match the current image.
An exception is raised if Dest is an unsupported type.


Examples

// Copy the displayed image to a TBitmap
MyBitmap := TBitmap.Create();
ImageEnView1.IEBitmap.AssignTo( MyBmp, 500, 500, rfFastLinear );
MyBitmap will now be an image of width <= 500 and height <= 500 (maintaining the aspect ratio)

// Copy the displayed image to a TImage
ImageEnView1.IEBitmap.AssignTo( Image1 );


TIEBitmap 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 bitmap
MergeAlphaRectTo With TIEBitmap Merges the alpha channels of two TIEBitmaps 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 Methods
Method Mode Purpose
Assign From TIEBitmap/TBitmap/TGraphic/TIcon Copy whole image
AssignTo To TIEBitmap/TBitmap Copy whole image with optional scaling
AssignRect From TIEBitmap/TBitmap Copy a specified rect
CopyFromTBitmap From TBitmap Copy whole image
CopyToTBitmap To TBitmap Copy whole image
RenderToTBitmapEx To TBitmap Extended drawing of content to a TBitmap

TCanvas Methods
Method Mode Purpose
DrawToCanvas To TCanvas Copies whole image to canvas at specified position (ignoring the alpha channel)
DrawToCanvasWithAlpha To TCanvas Copies whole image to canvas at specified position (honoring the alpha channel)
RenderToCanvas To TCanvas Extended drawing of content to a TCanvas (ignoring the alpha channel)
RenderToCanvasWithAlpha To TCanvas Extended drawing of content to a TCanvas (honoring the alpha channel)