GraphicsPath ::AddRectangle(constRectF&) , méthode (gdipluspath.h)

La méthode GraphicsPath ::AddRectangle ajoute un rectangle à ce chemin.

Syntaxe

Status AddRectangle(
  const RectF & rect
);

Paramètres

rect

Référence à un rectangle à ajouter au chemin d’accès.

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 d’objet GraphicsPath , ajoute un rectangle au chemin, puis dessine le chemin.

VOID Example_AddRectangle(HDC hdc)
{
   Graphics graphics(hdc);
   RectF rect(20.0f, 20.0f, 100.0f, 50.0f);

   GraphicsPath path;
   path.AddRectangle(rect);

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

Configuration requise

   
En-tête gdipluspath.h

Voir aussi

Méthodes AddPolygon

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

Pointf

Polygones