AddLineToPath

Vector graphics, Path definition and drawing

Description

Fügt dem aktuellen Pfad eine gerade Linie vom aktuellen Punkt des Pfads zum neuen Punkt bei (EndX, EndY) hinzu; Der aktuelle Punkt wird dann auf (EndX, EndY) verschoben, sodass das nächste Pfadprimitiv dort fortgesetzt wird

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

EndXDie horizontale Koordinate des Endpunkts der Linie
EndYDie vertikale Koordinate des Endpunkts der Linie

Return values

0Fehlgeschlagen — es ist kein Dokument geöffnet oder es wurde kein Pfad mit StartPath gestartet
1Das Liniensegment wurde dem aktuellen Pfad hinzugefügt

Remarks

Rufen Sie StartPath vor dem ersten AddLineToPath auf, um den Startpunkt des Pfads festzulegen; Rufen Sie nach dem vollständigen Zusammenbau des Pfads DrawPath oder DrawPathEvenOdd auf, um ihn zu zeichnen; Verwenden Sie ClosePath, um ein letztes Segment zurück zum Startpunkt zu zeichnen

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