ImageEn, unit iemview

TImageEnMView.GetTIEBitmap

TImageEnMView.GetTIEBitmap


Declaration

function GetTIEBitmap(idx: Integer; FullResolution: Boolean = False): TIEBitmap;


Description

Creates a TIEBitmap 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 TIEBitmap 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: This is only possible if the file can be reloaded, and will assign a full quality image to the TImageEnMView.


Examples

// Save the fifth image to file
bmp := ImageEnMView1.GetTIEBitmap(4); // Note: bmp must be TIEBitmap type
bmp.Write('D:\alfa.png');
ImageEnMView1.ReleaseBitmap(4, False);


// Add copyright text to all images
for i := 0 to ImageEnMView1.ImageCount - 1 do
begin
  bmp := ImageEnMView1.GetTIEBitmap( i );
  with TImageEnProc.CreateFromBitmap( bmp ) do
  begin
    ConvertTo24Bit();
    TextOut(Align_Text_Horz_Center, Align_Text_Near_Bottom, 'Copyright Skynet', 'Arial', 25, clRed, [fsBold], 0, True);
    Free;
  end;

  ImageEnMView1.ReleaseBitmap( i, True );
end;
ImageEnMView1.Update();


// Rotate selected images right (90° clockwise)
for i := 0 to ImageEnMView1.ImageCount - 1 do
  if ImageEnMView1.IsSelected( i ) then
  begin
    bmp := ImageEnMView1.GetTIEBitmap( i );
    bmp.Rotate( 270 );
    ImageEnMView1.ReleaseBitmap( i, True );
  end;
ImageEnMView1.Update();