HotPDF Delphi PDF Component Developer Guide loslab Logo

 

THPDFCurrentDocument.DrawArc

THPDFPage

 

Top  Previous  Next

Draws an arc along the perimeter of the ellipse bounded by the specified rectangle.

 

Delphi syntax:

function DrawArc( X1, Y1, X2, Y2, X3, Y3, X4, Y4: Single ):TCurrPoint;

TCurrPoint Type Definition

TPDFCurrPoint defines a point.

Unit
HPDFDoc

type
    THPDFCurrPoint = record
        X: Extended;
        Y: Extended;
end;

Description:
The THPDFCurrPoint type defines a pixel location. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.

 

C++ syntax:

TCurrPoint __fastcall DrawArc( float X1, float Y1, float X2, float Y2, float X3, float Y3, float X4, float Y4 );

 

Description

Use DrawArc to draw an elliptically curved line. The arc traverses the perimeter of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The arc is drawn following the perimeter of the ellipse, counterclockwise, from the starting point to the ending point. The starting point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X3,Y3). The ending point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X4, Y4).

 

Code Example

program ArcExample;
{$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 := '.\Curve.pdf';                                             // Set PDF filename
        HPDF.BeginDoc;                                                              // Create PDF file
        HPDF.CurrentPage.DrawArc(10, 10, 110, 110, 50, 10, 10, 50); // Draw Arc
        HPDF.CurrentPage.Stroke;                                                    // Stroke curve
        HPDF.EndDoc;                                                                // Close PDF file
    finally
        HPDF.Free;
    end;
end.
Copyright©2007-2025 losLab.com