GraphicsPath ::AddLine(constPointF&,constPointF&) (gdipluspath.h)

La méthode GraphicsPath ::AddLine ajoute une ligne à la figure actuelle de ce chemin.

Syntaxe

Status AddLine(
  const PointF & pt1,
  const PointF & pt2
);

Paramètres

pt1

Référence à un point auquel démarrer la ligne.

pt2

Référence à un point auquel terminer la ligne.

Valeur retournée

Type :Status

Si la méthode réussit, elle retourne Ok, qui est un élément de l’énumération Status .

Si la méthode échoue, elle retourne l’un des autres éléments de l’énumération Status .

Notes

Exemples

L’exemple suivant crée un chemin d’accès à l’objet GraphicsPath , ajoute une ligne au chemin, puis dessine le chemin.

VOID Example_AddLine(HDC hdc)
{
   Graphics graphics(hdc);

   PointF point1(20.0f, 20.0f);
   PointF point2(100.0f, 100.0f);

   GraphicsPath path;
   path.AddLine(point1, point2);

   // Draw the path.
   Pen pen(Color(255, 255, 0, 0));
   graphics.DrawPath(&pen, &path);
}

Configuration requise

Condition requise Valeur
En-tête gdipluspath.h

Voir aussi

Méthodes AddLine

Méthodes AddLines

Découpage avec une région

Génération et dessin de tracés

Création d’un dégradé de chemin

Graphicspath

Chemins d’accès

Stylos, lignes et rectangles

Pointf

Utilisation d’un stylo pour tracer des lignes et des rectangles