ClosePath
Graphiques vectoriels, définition et dessin des tracés
Description
Ferme le sous-chemin actuel commencé par StartPath. Une ligne droite relie le point courant au point initial, formant une seule forme fermée. ClosePath ne peint pas le chemin ; appelez ensuite DrawPath ou DrawPathEvenOdd pour tracer ou remplir
Syntaxe
Delphi
Function TPDFlib.ClosePath: Integer;
ActiveX
Function PDFlib::ClosePath() As Long
DLL
int DLClosePath(int InstanceID);
Valeurs de retour
| 0 | Échec — aucun document n’est ouvert ou aucun chemin n’a été démarré |
|---|---|
| 1 | Le sous-chemin actuel a été fermé |
Remarques
Fermer le chemin est important pour son contour : un chemin ouvert laisse un espace entre le dernier et le premier point, avec une extrémité plate plutôt qu’une jointure. Pour un remplissage, la ligne est implicite, mais une fermeture explicite donne un résultat plus propre et est requise avant un nouveau sous-chemin avec StartPath
Exemple
// Draw a closed triangle, stroked
PDF.SetStrokeColor(0, 0, 0);
PDF.SetLineWidth(1);
PDF.StartPath(100, 100);
PDF.AddLineToPath(200, 100);
PDF.AddLineToPath(150, 180);
PDF.ClosePath; // line back to (100, 100)
PDF.DrawPath(0); // 0 = outline onlyVoir aussi
StartPath, AddLineToPath, AddCurveToPath, DrawPath, DrawPathEvenOdd