DrawPath
Graphiques vectoriels, définition et dessin des tracés
Description
Peint le chemin actuel, assemblé par StartPath, AddLineToPath, AddCurveToPath, AddArcToPath et ClosePath, avec la règle d’enroulement non nul. Après le tracé, l’état du chemin est réinitialisé et le prochain StartPath commence une nouvelle forme
Syntaxe
Delphi
Function TPDFlib.DrawPath(PathOptions: Integer): Integer;
ActiveX
Function PDFlib::DrawPath(PathOptions As Long) As Long
DLL
int DLDrawPath(int InstanceID, int PathOptions);
Paramètres
| PathOptions | Mode de tracé : 0 — Contour uniquement (tracé avec les paramètres de ligne actuels) 1 — Remplissage uniquement (avec la couleur de remplissage actuelle et la règle d’enroulement non nulle) 2 — Remplissage et contour |
|---|
Valeurs de retour
| 0 | Échec — PathOptions se trouve hors limites, aucun document n'est ouvert ou aucun chemin n'a été démarré |
|---|---|
| 1 | Le chemin a été peint |
Remarques
Définissez les couleurs de contour et de remplissage ainsi que les attributs de ligne (SetLineWidth, SetLineCap, SetLineDash) avant d’appeler DrawPath. L’état graphique actuel est échantillonné au site d’appel
Pour les chemins superposés ou auto-intersectés, la règle non nulle traite chaque sous-chemin comme une même région : un trou exige un sous-chemin interne en sens inverse. Si cela est gênant, utilisez DrawPathEvenOdd ; la règle paire-impaire alterne simplement intérieur et extérieur à chaque croisement
Exemple
// Filled outlined diamond
PDF.SetStrokeColor(0, 0, 0);
PDF.SetFillColor(0.6, 0.8, 1);
PDF.SetLineWidth(1.5);
PDF.StartPath(150, 100);
PDF.AddLineToPath(200, 150);
PDF.AddLineToPath(150, 200);
PDF.AddLineToPath(100, 150);
PDF.ClosePath;
PDF.DrawPath(2); // 2 = fill and outlineVoir aussi
DrawPathEvenOdd, StartPath, AddLineToPath, AddCurveToPath, AddArcToPath, ClosePath, SetLineWidth