THPDFPage.Rectangle

THPDFPage

 

トップへ  前へ  次へ

四角形を描画します。

 

Delphi 構文:

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

 

C++ 構文:

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

 

説明

Rectangle を使用して四角形を描画します。四角形の座標とサイズを指定します。座標は、左上の点 (X, Y)、幅、および高さを定義します。

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.

 

コード例

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.File名前 := '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.