THotPDF.Canvas 속성

 

THotPDF.Canvas

THotPDF

 

Top  Previous  Next

문서 캔버스에 접근합니다.

 

Delphi syntax:

property Canvas: TCanvas;

 

C++ syntax:

__property Graphics::TCanvas* Canvas;

 

Description

TCanvas 그리기 메서드를 사용해 PDF 문서에 그리려면 Canvas 프로퍼티를 사용합니다.

 

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;