THPDFPage.Rectangle

THPDFPage

 

Arriba  Anterior  Siguiente

Draws a rectangle.

 

Sintaxis Delphi:

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

 

Sintaxis C++:

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

 

Descripción

Utilice Rectangle para dibujar un rectángulo. Especifique las coordenadas y el tamaño del rectángulo. Coordinates define la esquina superior izquierda en el punto (X, Y), así como el ancho y la altura

Para rellenar una región rectangular use Fill. Para trazar el contorno de una región rectangular sin rellenarla, use Stroke. Para dibujar un rectángulo con las esquinas redondeadas, use RoundRect.

 

Ejemplo de código

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.