AddLineToPath

Graphiques vectoriels, définition et dessin des tracés

Description

Ajoute une ligne droite au chemin actuel, du point courant jusqu’au nouveau point (EndX, EndY). Le point courant est ensuite déplacé vers (EndX, EndY), afin que la primitive de chemin suivante se poursuive depuis cet emplacement

Syntaxe

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

Paramètres

EndXCoordonnée horizontale du point final de la ligne
EndYCoordonnée verticale du point final de la ligne

Valeurs de retour

0Échec — aucun document n'est ouvert ou aucun chemin n'a été démarré avec StartPath
1Le segment de ligne a été ajouté au chemin actuel

Remarques

Appelez StartPath avant le premier AddLineToPath pour définir le point initial. Une fois le chemin assemblé, appelez DrawPath ou DrawPathEvenOdd pour le peindre. Utilisez ClosePath pour revenir au point de départ

Exemple

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

Voir aussi

StartPath, AddCurveToPath, AddArcToPath, AddBoxToPath, ClosePath, DrawPath