Declaration
procedure Assign(Source: TObject);
Description
Copies an image from source object. Source can be a
TIEBitmap, TBitmap, TGraphic, TPicture or TIcon.
Notes:
- The
Params are also copied (if
ParamsEnabled is true for both source and destination).
- Assign copies the
alpha channel of a TIEBitmap, use
AssignImage to only copy the image
- To assign a
TIEVisionImage, use
AssignIEVisionImageExamples
// Display the same image as a TImage
ImageEnView1.IEBitmap.Assign( Image1.Picture.Graphic );
ImageEnView1.Update();
// Copy from a TGraphic class
jpg := TJpegImage.Create;
try
jpg.Loadfromfile( 'D:\Image.jpg' );
ImageEnView1.IEBitmap.Assign( jpg );
ImageEnView1.Update();
finally
jpg.free
end;
// Assign a 32bit Bitmap with alpha channel to an ImageEnView (keeping the alpha)
var
bmp: TBitmap;
begin
bmp := TBitmap.Create();
bmp.LoadFromFile( 'Bmp32_with_Alpha.bmp' );
ImageEnView1.IEBitmap.Assign( bmp );
ImageEnView1.IEBitmap.SynchronizeRGBA( True, True );
ImageEnView1.Update();
bmp.Free();
end;
See Also
-
SynchronizeRGBATIEBitmap 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