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
| EndX | Coordonnée horizontale du point final de la ligne |
|---|---|
| EndY | Coordonné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 |
|---|---|
| 1 | Le 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 onlyVoir aussi
StartPath, AddCurveToPath, AddArcToPath, AddBoxToPath, ClosePath, DrawPath