AddLineToPath

Vector graphics, Path definition and drawing

Description

Ajoute une ligne droite au tracé (path) actuel, du point actuel du tracé au nouveau point situé à (EndX, EndY) ; le point actuel est ensuite déplacé vers (EndX, EndY) de sorte que la primitive de tracé suivante commence à partir de là

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

EndXThe horizontal co-ordinate of the line's end point.
EndYThe vertical co-ordinate of the line's end point.

Return values

0Failed — no document is open or no path has been started with StartPath.
1The line segment was added to the current path.

Remarks

Appelez StartPath avant le premier AddLineToPath pour définir le point de départ du tracé (path) ; une fois le tracé entièrement assemblé, appelez DrawPath ou DrawPathEvenOdd pour le peindre ; utilisez ClosePath pour tracer un segment final ramenant au point de départ

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