THPDFPage.RoundRect

THPDFPage

 

トップへ  前へ  次へ

キャンバス上に角が丸い四角形を描画します。

 

Delphi 構文:

procedure RoundRect ( X1, Y1, X2, Y2, X3, Y3: Integer );

 

C++ 構文:

void __fastcall RoundRect ( int X1, int Y1, int X2, int Y2, int X3, int Y3);

 

説明

 

RoundRect を使用して角が丸い四角形を描画します。四角形は、点 (X1,Y1)、(X2,Y1)、(X2,Y2)、(X1,Y2) によって定義されるエッジを持ちますが、角は削られて丸みを帯びた外観になります。角の丸みの曲線は、幅 X3、高さ Y3 の楕円の曲率と一致します。

 

To draw an ellipse instead, use Ellipse. To draw a true rectangle, use Rectangle.

 

コード例

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

var
    HPDF: THotPDF;

const
    DashArray: array[0..3] of Byte = (6, 4, 2, 4);

begin
    HPDF := THotPDF.Create(nil);
    try
        HPDF.AutoLaunch := true;                  // PDF file will be shown automatically
        HPDF.File名前 := '\RoundRect.pdf';   // Set PDF filename
        HPDF.BeginDoc;                                // Create PDF file

        HPDF.CurrentPage.SetDash( DashArray, 0 );                    // Set  - . -  dash pattern
        HPDF.CurrentPage.RoundRect( 10, 10, 200, 100, 20, 20 ); // Draw round rect
        HPDF.CurrentPage.Stroke;                                              // and stroke

        HPDF.EndDoc;                         // Close PDF file
    finally
        HPDF.Free;
    end;
end.