PDFium Component Docs

AddImage metodă

Component: TPdfView  ·  Unit: PDFium
Adaugă o imagine pe pagina afișată în prezent de TPdfView, convertind un dreptunghi din coordonate client ale viewerului în coordonate de pagină PDF

Syntax

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

 

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

Description

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.

Remarks

Example

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

See Also

AddPicture, TPdf.AddImage, DeviceToPage, UpdatePage