Thuộc tính THotPDF.Canvas

 

THotPDF.Canvas

THotPDF

 

Đầu trang  Trước  Tiếp

Cung cấp quyền truy cập vào canvas của tài liệu

 

Cú pháp Delphi:

property Canvas: TCanvas;

 

Cú pháp C++:

__property Graphics::TCanvas* Canvas;

 

Mô tả

Dùng thuộc tính Canvas để vẽ lên tài liệu PDF trong các phương thức vẽ của TCanvas

 

Ví dụ mã

var
  Bitmap: TBitmap;

begin
  Bitmap := TBitmap.Create;
  try
    Bitmap.Width := 200;
    Bitmap.Height := 200;
    Bitmap.Canvas.Brush.Color := clRed;
    Bitmap.Canvas.FillRect( Rect( 0, 0, 200, 200 ) );
    Bitmap.Canvas.Brush.Color := clBlue;
    Bitmap.Canvas.Ellipse( 50, 50, 150, 150 );

    HPDF.Canvas := Bitmap.Canvas;              // Assign Delphi Canvas to HotPDF
    HPDF.CurrentPage.ShowImage( 0, 100, 100, 200, 200 );
  finally
    Bitmap.Free;
  end;
end;