THotPDF.AddImage Method

 

THotPDF.AddImage

THotPDF

 

Top  Previous  Next

Adds a specified image to PDF document.

 

Delphi syntax:

function AddImage(Image: TGraphic; Compression: THPDFImageCompressionType;

                            IsMask: boolean = False; MaskIndex: Integer = -1): Integer; overload;

 

function AddImage(FileName: TFileName; Compression: THPDFImageCompressionType;

                            IsMask: boolean = False; MaskIndex: Integer = -1): Integer; overload;

 

Description

Call AddImage to register an image and obtain an image handle that can later be drawn with CurrentPage.ShowImage. The file overload accepts BMP and JPEG files, while the graphic overload accepts a loaded TGraphic instance. Compression selects the PDF image compression method. IsMask indicates whether the image is used as a mask, and MaskIndex identifies the associated mask image.

 

Code Example


var
  ImageHandle: Integer;
begin
  ImageHandle := HPDF.AddImage( '.\Sample.jpg', icJpeg );
  HPDF.CurrentPage.ShowImage( ImageHandle, 100, 200, 150, 100 );  // Draw the image at position 100,200 with size 150x100
end;

 

See also: CurrentPage.ShowImage