PDFium Delphi Component Docs

метод AddImage

Компонент: TPdfView  ·  Модул: PDFium
Добавя изображение към страницата, която в момента се показва от TPdfView, като преобразува правоъгълник от клиентските координати на прегледача в координати на PDF страницата

Синтаксис

procedure AddImage(const FileName: string; X, Y, Width, Height: Integer); overload;

 

procedure AddImage(Bitmap: TBitmap; X, Y, Width, Height: Integer); overload;

Описание

AddImage inserts a raster image into the page currently displayed by TPdfView. Unlike TPdf.AddImage, which receives PDF user-space coordinates, this overload accepts the same client-coordinate rectangle used by the viewer.

The file overload loads the image through TPicture.LoadFromFile and then follows the same conversion path as AddPicture. Any image format registered with the active VCL or LCL graphics stack can be used.

The bitmap overload inserts an existing TBitmap without loading from disk. Passing nil raises EPdfError. Both overloads call DeviceToPage for the top-left and bottom-right viewer points, then write a PDF image object with the resulting page rectangle.

Забележки

Пример

if PdfView1.Active then
begin
  PdfView1.AddImage('C:\Images\logo.png', 24, 180, 120, 48);
  PdfView1.UpdatePage;
end;

Виж също

AddPicture, TPdf.AddImage, DeviceToPage, UpdatePage