AddLineToPath

벡터 그래픽, 경로 정의 및 그리기

설명

경로의 현재 점에서 (EndX, EndY)의 새 점까지 직선을 추가합니다. 현재 점은 (EndX, EndY)로 이동하므로 다음 경로 기본 요소가 그곳에서 이어집니다

구문

Delphi

Function TPDFlib.AddLineToPath(EndX, EndY: Double): Integer;

ActiveX

Function PDFlib::AddLineToPath(EndX As Double, EndY As Double) As Long

DLL

int DLAddLineToPath(int InstanceID, double EndX, double EndY);

매개변수

EndX선 끝점의 가로 좌표
EndY선 끝점의 세로 좌표

반환 값

0실패 — 열린 문서가 없거나 StartPath로 경로를 시작하지 않았습니다
1선분을 현재 경로에 추가했습니다

비고

StartPath를 첫 번째 AddLineToPath 전에 호출하여 경로 시작점을 설정합니다. 경로를 완전히 구성한 뒤 DrawPath 또는 DrawPathEvenOdd를 호출하여 칠합니다. 시작점으로 돌아가는 마지막 세그먼트를 그리려면 ClosePath를 사용합니다

예제

// A zig-zag polyline
PDF.SetStrokeColor(0, 0, 0);
PDF.SetLineWidth(1);
PDF.StartPath(50, 100);
PDF.AddLineToPath(100, 150);
PDF.AddLineToPath(150, 100);
PDF.AddLineToPath(200, 150);
PDF.AddLineToPath(250, 100);
PDF.DrawPath(0);                       // 0 = outline only

참고 항목

StartPath, AddCurveToPath, AddArcToPath, AddBoxToPath, ClosePath, DrawPath