ImageEn, unit iemview

TImageEnMView.GetBitmap

TImageEnMView.GetBitmap


Declaration

function GetBitmap(idx: Integer; FullResolution: Boolean = False): TBitmap;


Description

Creates a TBitmap object from the image at index, idx.
Any changes you make to the bitmap will be visible after you call the Update method.
You will need to call ReleaseBitmap to free the TBitmap object (and update the TImageEnMView if changes were made).
If FullResolution is true, it returns the full size of the image rather than a thumbnail, even if StoreType is ietThumb or ietFastThumb.

Note: GetBitmap converts internal image storage to TBitmap, which has poor memory handling. You are better to use GetTIEBitmap and if needed, copy the result to a bitmap.


Demo

Demo  Demos\Multi\Multiview_PrintFrame\Multiview.dpr


Example

// Save the fifth image to file
bmp := ImageEnMView1.GetBitmap(4);
bmp.SaveToFile('alfa.bmp');
ImageEnMView1.ReleaseBitmap(4);

// Better way to do it...
var
  bmp: TBitmap;
  iebmp: TIEBitmap;
begin
  bmp := TBitmap.Create();

  iebmp := ImageEnMView1.GetTIEBitmap(4);
  iebmp.CopyToTBitmap( bmp );
  ImageEnMView1.ReleaseBitmap(4, False);

  bmp.SaveToFile('alfa.bmp');
  ImageEnMView1.ReleaseBitmap(4);
  bmp.Free();
end;