AddArcToPath

Vector graphics, Path definition and drawing

Description

Agrega un arco circular al trazado actual; el arco se dibuja alrededor del punto central (CenterX, CenterY); su radio es igual a la distancia desde el centro hasta el punto actual del trazado, y se extiende por TotalAngle grados; el punto actual después de la llamada es el punto final del arco, por lo que las llamadas posteriores a AddLineToPath o AddArcToPath continúan desde allí

Syntax

Delphi

Function TPDFlib.AddArcToPath(CenterX, CenterY, TotalAngle: Double): Integer;

ActiveX

Function PDFlib::AddArcToPath(CenterX As Double, CenterY As Double, TotalAngle As Double) As Long

DLL

int DLAddArcToPath(int InstanceID, double CenterX, double CenterY, double TotalAngle);

Parameters

CenterXLa coordenada horizontal del centro del arco
CenterYLa coordenada vertical del centro del arco
TotalAngleEl barrido angular en grados; los valores positivos realizan el barrido en el sentido de las agujas del reloj; los valores negativos realizan el barrido en sentido contrario; el valor debe ser distinto de cero; 360 (o -360) dibuja un círculo completo

Return values

0Error: no hay ningún documento abierto, no se ha iniciado ninguna ruta o TotalAngle es cero
1El arco fue agregado a la ruta actual

Remarks

El radio se deriva implícitamente de la distancia entre el punto actual (establecido por el más reciente StartPath, AddLineToPath, AddCurveToPath, o el AddArcToPath anterior) y el centro pasado a esta llamada. Para dibujar un círculo completo, StartPath a cualquier punto de la circunferencia del círculo y llame a AddArcToPath con el centro deseado y un barrido de 360

The arc is rendered as a chain of cubic Bézier segments, accurate to within sub-pixel tolerance for typical PDF page sizes.

Example

// A pie slice — straight edge, arc, straight edge back to centre
PDF.SetFillColor(0.7, 0.2, 0.2);

PDF.StartPath(200, 200);               // pie centre
PDF.AddLineToPath(280, 200);           // out to circle (radius 80, angle 0°)
PDF.AddArcToPath(200, 200, 90);        // sweep 90° clockwise
PDF.ClosePath;                         // back to the centre
PDF.DrawPath(2);                       // 2 = fill and outline

// A complete circle drawn as a single arc
PDF.StartPath(300, 100);
PDF.AddArcToPath(250, 100, 360);
PDF.ClosePath;
PDF.DrawPath(0);

See also

StartPath, AddLineToPath, AddCurveToPath, AddBoxToPath, DrawPath, DrawPathEvenOdd