| ImageEn, unit ImageEnView |
|
TImageEnView.SetExternalBitmap
Declaration
procedure SetExternalBitmap(Bmp: TIEBitmap);
Description
Allows you to connect the TImageEnView component to another
TIEBitmap, including sharing the bitmap of another TImageEnView.
This is useful to view the same image with multiple TImageEnView components, but loading the image only once.
Note: To detach the TImageEnView object from your bitmap, call: ImageEnView1.SetExternalBitmap(nil);
Important
It is recommended that you call SetExternalBitmap(nil) before freeing your TIEBitmap.
If you free the TIEBitmap while it is still attached, TIEBitmap.Destroy will auto-detach from the view (when the view is not already destroying).
extBMP := TIEBitmap.Create();
try
ImageEnView1.SetExternalBitmap( extBMP );
...
Do something with extBMP
...
finally
ImageEnView1.SetExternalBitmap( nil ); // Ensure TImageEnView does not point to invalid object
extBMP.Free();
end;
Demo
| Demos\Display\ExternalBitmap\ExternalBMP.dpr |
Example
// Share another view's bitmap
ImageEnView1.IO.LoadFromFile('C:\input.jpg');
ImageEnView2.SetExternalBitmap( ImageEnView1.IEBitmap );
// Both ImageEnView1 and ImageEnView2 now show input.jpg