AddArcToPath
Vector graphics, Path definition and drawing
Description
Adiciona um arco circular ao caminho atual; o arco é desenhado ao redor do ponto central (CenterX, CenterY); seu raio é igual à distância do centro ao ponto atual do caminho, e ele se estende por TotalAngle graus; o ponto atual após a chamada é o ponto final do arco, portanto, chamadas subsequentes a AddLineToPath ou AddArcToPath continuam a partir dali
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
| CenterX | A coordenada horizontal do centro do arco |
|---|---|
| CenterY | A coordenada vertical do centro do arco |
| TotalAngle | A varredura angular em graus; valores positivos varrem no sentido horário; valores negativos varrem no sentido anti-horário; o valor deve ser diferente de zero; 360 (ou -360) desenha um círculo completo |
Return values
| 0 | Falhou — nenhum documento está aberto, nenhum caminho foi iniciado ou TotalAngle é zero |
|---|---|
| 1 | O arco foi adicionado ao caminho atual |
Remarks
O raio é derivado implicitamente da distância entre o ponto atual (definido pelo mais recente StartPath, AddLineToPath, AddCurveToPath ou AddArcToPath anterior) e o centro passado para esta chamada; para desenhar um círculo completo, use StartPath para qualquer ponto na circunferência do círculo e chame AddArcToPath com o centro desejado e uma varredura 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