THPDFPage.ShowImage

THPDFPage

 

Đầu trang  Trước  Tiếp

Hiển thị hình ảnh tại tọa độ đã chỉ định

 

Cú pháp Delphi:

procedure ShowImage ( ImageIndex: Integer; X, Y, W, H, Angle: Extended );

 

Cú pháp C++:

void __fastcall ShowImage ( int ImageIndex, Extended x, Extended y, Extended w, Extended h, Extended Angle );

 

Mô tả:

Gọi ShowImage để vẽ hình ảnh được chỉ định bởi chỉ số ( ImageIndex do THotPDF.AddImage trả về ), tọa độ ( X, Y ), chiều rộng và chiều cao ( W, H ) cùng góc xoay ( Angle )

 

Ví dụ mã

program ImageDemo;
{$APPTYPE CONSOLE}
uses
  SysUtils,
  Graphics,
  Classes,
  HPDFDoc;

var
   I: Integer;
   HPDF: THotPDF;
   Index: Integer;

begin
  HPDF:= THotPDF.Create( nil );
  try
    HPDF.AutoLaunch := true;                     // PDF file will be shown automatically
    HPDF.FileName := '\ImageDemo.pdf';     // Set PDF filename

    HPDF.BeginDoc;                    // Create PDF file

    Index := HPDF.AddImage( '\Image.jpg', icJpeg );                     // Add image to the document
    HPDF.CurrentPage.ShowImage( Index, 10, 10, 390, 300, 0 );   // Show image with sizes 390 x 300

    HPDF.EndDoc;                       // Close PDF file
  finally
      HPDF.Free;
  end;
end.