THPDFPage.RoundRect

THPDFPage

 

Haut  Précédent  Suivant

Dessine un rectangle aux coins arrondis sur le canevas

 

Syntaxe Delphi :

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

 

Syntaxe C++ :

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

 

Description

 

Utilisez RoundRect pour dessiner un rectangle à coins arrondis. Le rectangle aura des côtés définis par les points (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2), mais les coins seront rognés pour créer un aspect arrondi. La courbe des coins arrondis correspond à la courbure d'une ellipse de largeur X3 et de hauteur Y3

 

Pour dessiner une ellipse à la place, utilisez Ellipse. Pour dessiner un vrai rectangle, utilisez Rectangle

 

Exemple de code

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.FileName := '\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.