Declaration
procedure SwitchTo(Target: TIEBitmap);
Description
Assigns the current image to the target object. The source object will then be empty.
Executes more quickly than a copy operation because the image is transferred rather than copied.
Specifically, it assigns all fields to
Target, and zeroes all parameters (so don't free the image or allocated memory).
Example
var
iebmp1, iebmp2: TIEBitmap;
begin
iebmp1 := TIEBitmap.create;
iebmp2 := TIEBitmap.create;
iebmp1.Read( 'D:\image.jpeg' );
iebmp1.SwitchTo( iebmp2 );
// iebmp1 is now nil
iebmp2.Write( 'D:\image2.jpeg' );
iebmp2.Free;
TIEBitmap Assignment and Drawing Methods
TIEBitmap Methods Method | Mode | Notes |
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