THotPDF.AddImage Method

 

THotPDF.AddImage

THotPDF

 

Viršus  Ankstesnis  Kitas

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;

 

Aprašas

Kviesti AddImage, kad užregistruotumėte vaizdą ir gautumėte vaizdo rankeną, kurią vėliau galima piešti su CurrentPage.ShowImage. Failo overload priima BMP ir JPEG failus, o grafinis overload priima įkeltą TGraphic instance. Compression pasirenka PDF vaizdo glaudinimo metodą. IsMask nurodo, ar vaizdas naudojamas kaip kaukė, o MaskIndex identifikuoja susijusį kaukės vaizdą

 

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