ImageEn, unit iexPdfiumCore

TPdfObject.GetImage

TPdfObject.GetImage


Declaration

function GetImage(Dest: TIEBitmap): Boolean; overload;
function GetImage(): TBitmap; overload;


Description

Return a bitmap of an image object of the current page (when ObjectType is ptImage).

Note:
Use SetImage to replace the image of an object
Unlike GetImage will not fail for an unknown image/compression type


Examples

// Show preview of an image in the current PDF page
ImageEnView1.PdfViewer.Objects[idx].GetImage( ImageEnView2.IEBitmap );
ImageEnView2.Update();


// Save all images in the page to file
for i := 0 to ImageEnView1.PdfViewer.Objects.Count - 1 do
  if ImageEnView1.PdfViewer.Objects[i].ObjectType = ptImage then
  begin
    bmp := TIEBitmap.Create();
    if ImageEnView1.PdfViewer.Objects[i].GetImage( bmp ) then
      bmp.SaveToFile( 'D:\PDFTest\Object_' + i.ToString + '.png' );
    bmp.Free;
  end;


See Also

SetImage
GetImageRaw