THotPDF.Canvas Property

 

THotPDF.Canvas

THotPDF

 

傳回頂部  上一頁  下一頁

Gives access to the document canvas.

 

Delphi 語法:

property Canvas: TCanvas;

 

C++ 語法:

__property Graphics::TCanvas* Canvas;

 

說明

使用 Canvas property 在 TCanvas drawing methods 期間繪製到 PDF document

 

Code Example

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;