Declaration
procedure AssignRect(Source: TObject; SourceRect: TRect; AssignParams: Boolean = False);
Description
Copies a rectangle from source object. Source can be a
TIEBitmap,
TImageEnView or a TBitmap.
If AssignParams is enabled then the
Params are also copied (if
ParamsEnabled is true for both source and destination).
Note:
◼Source must have the same
PixelFormat as the image, or Source can be ie1g and Dest ie24RGB (i.e. Monochrome to RGB conversion)
◼If the
PixelFormat is ie8p, then you may also need to
copy the palette
◼When Source is TImageEnView, only the currently selected layer is copied (or the image if there are no layers/selection)
// Copy rect from a TBitmap
iebmp.AssignRect( bmp, Rect( 100, 100, 200, 200 ));
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