ImageEn, unit iexPdfiumCore

TPdfObject.GetImageRaw

TPdfObject.GetImageRaw


Declaration

function GetImageRaw(const Dest: TFilename): Boolean; overload;
function GetImageRaw(Dest: TStream): Boolean; overload;
function GetImageRaw(Dest: TIEBitmap): Boolean; overload;


Description

Returns the raw stream of an image within the current page to a file, stream or TIEBitmap.

Note:
 The raw format will return an image with an undetermined compression and type
 The TIEBitmap overload will fail if the image cannot be loaded
 Use GetImage to reliably return the image of an object


Example

// Show preview of an image in the current PDF page
if objType = ptImage then
begin
  bmp := TIEBitmap.Create();

  // Try raw if possible
  haveBMP := ImageEnView1.PdfViewer.Objects[idx].GetImageRaw( bmp );

  // Fall-back to bitmap
  if not haveBMP then
    haveBMP := ImageEnView1.PdfViewer.Objects[idx].GetImage( bmp );

  if haveBMP then
  begin
    ImageEnView2.Assign( bmp );
    ImageEnView2.Fit( False );
  end;
  bmp.Free();
end;


See Also

 GetImage
 SetImage