THPDFPage.Rectangle

THPDFPage

 

맨 위  이전  다음

Draws a rectangle.

 

Delphi 구문:

procedure Rectangle ( X, Y, Width, Height: Single );

 

C++ 구문:

void __fastcall Rectangle ( float X, float Y, float Width, float Height );

 

설명

Rectangle을 그리려면 Rectangle을 사용하십시오. Rectangle의 coordinate와 size를 지정합니다. Coordinate는 point(X, Y)의 upper left corner와 width 및 height를 정의합니다

To fill a rectangular region use Fill. To outline a rectangular region without filling it, use Stroke. To draw a rectangle with rounded corners, use RoundRect.

 

Code Example

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

var
    HPDF: THotPDF;

begin
    HPDF := THotPDF.Create(nil);
    try
        HPDF.AutoLaunch := true;                                 // PDF file will be shown automatically
        HPDF.FileName := 'Rectangle.pdf';                   // Set PDF filename
        HPDF.BeginDoc;                                               // Create PDF file
        HPDF.CurrentPage.Rectangle( 10, 10, 100, 100 ); // Draw rectangle and fill
        HPDF.CurrentPage.ClosePathEoFillAndStroke;
        HPDF.EndDoc;                                                  // Close PDF file
    finally
        HPDF.Free;
    end;
end.