ImageEn, unit imageenview

TImageEnView.SetExternalBitmap

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 (to avoid potential issues when the TImageEnView is destroyed).
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

Demo  Demos\Display\ExternalBitmap\ExternalBMP.dpr

Example

ImageEnView1.IO.LoadFromFile('C:\input.jpg');
ImageEnView2.SetExternalBitmap( ImageEnView1.IEBitmap );

..Both ImageEnView1 and ImageEnView2 now show input.jpg.