AddArcToPath
Vector graphics, Path definition and drawing
Description
현재 경로에 원형 호를 추가함; 호는 중심점 (CenterX, CenterY) 주위에 그려지며 반지름은 중심에서 경로의 현재 점까지의 거리와 같고 TotalAngle 도 만큼 회전함; 호출 후 현재 점은 호의 끝점이므로 이후의 AddLineToPath 또는 AddArcToPath 호출은 거기에서 계속됨
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 | 호 중심의 수평 좌표 |
|---|---|
| CenterY | 호 중심의 수직 좌표 |
| TotalAngle | 도 단위의 각도 스윕입니다; 양수 값은 시계 방향으로 스윕하고, 음수 값은 반시계 방향으로 스윕합니다; 값은 0이 아니어야 합니다; 360(또는 -360)은 전체 원을 그립니다 |
Return values
| 0 | 실패 — 문서가 열려 있지 않거나 경로가 시작되지 않았거나 TotalAngle이 0임 |
|---|---|
| 1 | 호가 현재 경로에 추가되었습니다 |
Remarks
반지름은 가장 최근의 StartPath, AddLineToPath, AddCurveToPath 또는 이전 AddArcToPath에 의해 설정된 현재 지점과 이 호출에 전달된 중심 사이의 거리에서 암시적으로 유도됩니다; 완전한 원을 그리려면 원 둘레의 임의의 지점으로 StartPath를 호출하고 원하는 중심 및 360의 스윕을 사용하여 AddArcToPath를 호출하십시오
호는 일반적인 PDF 페이지 크기에 대해 서브 픽셀 허용 오차 내에서 정확한 3차 베지에 세그먼트 체인으로 렌더링됩니다
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