AddLineToPath
Vektorgrafik, Pfaddefinition und Zeichnen
Beschreibung
Fügt dem aktuellen Pfad eine gerade Linie vom aktuellen Pfadpunkt zum neuen Punkt (EndX, EndY) hinzu. Anschließend wird der aktuelle Punkt auf (EndX, EndY) verschoben, sodass das nächste Pfadprimitiv von 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);
Parameter
| EndX | Die horizontale Koordinate des Linienendpunkts |
|---|---|
| EndY | Die vertikale Koordinate des Linienendpunkts |
Rückgabewerte
| 0 | Fehlgeschlagen — kein Dokument ist geöffnet oder mit StartPath wurde kein Pfad begonnen |
|---|---|
| 1 | Das Liniensegment wurde dem aktuellen Pfad hinzugefügt |
Anmerkungen
Rufen Sie StartPath vor dem ersten AddLineToPath auf, um den Anfangspunkt des Pfads festzulegen. Nachdem der Pfad vollständig zusammengesetzt wurde, rufen Sie DrawPath oder DrawPathEvenOdd auf, um ihn zu zeichnen. Verwenden Sie ClosePath, um ein letztes Segment zurück zum Anfangspunkt zu zeichnen
Beispiel
// 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 onlySiehe auch
StartPath, AddCurveToPath, AddArcToPath, AddBoxToPath, ClosePath, DrawPath