ImageEn, unit iexPdfiumCore

TPdfObjectList.AddImage

TPdfObjectList.AddImage


Declaration

function AddImage(X, Y, Width, Height: Single; Bitmap: TBitmap; MaintainAR: Boolean = True): TPdfObject; overload;
function AddImage(X, Y, Width, Height: Single; Bitmap: TIEBitmap; MaintainAR: Boolean = True): TPdfObject; overload;
function AddImage(X, Y, Width, Height: Single; const Filename: string; MaintainAR: Boolean = True): TPdfObject; overload;


Description

Adds an image object to the current page at the specified position (in terms of PDF points).

Note: PDF pages are specified Bottom-Up, i.e. Y=0 refers to the bottom of the page/screen. Y=PageHeight refers to the top of the page/screen


Example

var
  bmp: TIEBitmap;
begin
  if dlgOpenImage.Execute() then
  begin
    bmp := TIEBitmap.Create();
    try
      if bmp.Read( dlgOpenImage.Filename ) = False then
        EXIT;

      ImageEnView1.PdfViewer.Objects.AddImage( 100, 800, 200, 200, bmp );

      ImageEnView1.Invalidate();
    finally
      bmp.Free();
    end;
  end;
end;

// Which is the same as...
begin
  if dlgOpenImage.Execute() then
  begin
    ImageEnView1.PdfViewer.Objects.AddImage( f100, 800Y, 200, 200, dlgOpenImage.Filename );
    ImageEnView1.Invalidate();
  end;
end;