AddLineToPath

Vector graphics, Path definition and drawing

Description

在目前路徑中新增一條直線,從路徑的目前點延伸到新點 (EndX, EndY);隨後目前點會移至 (EndX, EndY),以便下一個路徑基本圖形從該處繼續

Syntax

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);

Parameters

EndX線段終點的水平座標
EndY線段終點的垂直座標

Return values

0失敗 — 未開啟任何文件,或未透過 StartPath 開始任何路徑
1線段已新增至目前路徑

Remarks

在第一次呼叫 AddLineToPath 之前先呼叫 StartPath,以設定路徑的起點;完整組合路徑後,呼叫 DrawPathDrawPathEvenOdd 進行繪製;使用 ClosePath 繪製最後一段以返回起點

Example

// 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

See also

StartPath, AddCurveToPath, AddArcToPath, AddBoxToPath, ClosePath, DrawPath