THotPDF.Canvas Property
HotPDF Delphi PDF Component Developer Guide loslab Logo

 

THotPDF.Canvas

THotPDF

 

Top  Previous  Next

Gives access to the document canvas.

 

Delphi syntax:

property Canvas: TCanvas;

 

C++ syntax:

__property Graphics::TCanvas* Canvas;

 

Description

Use the Canvas property to paint to the PDF document during the TCanvas drawing methods.

 

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;

 

Copyright©2007-2025 losLab.com