Share via


Graphics ::FillRectangle(constBrush*,constRectF&) méthode (gdiplusgraphics.h)

La méthode Graphics ::FillRectangle utilise un pinceau pour remplir l’intérieur d’un rectangle.

Syntaxe

Status FillRectangle(
  const Brush   *brush,
  const RectF & rect
);

Paramètres

brush

Pointeur vers un pinceau utilisé pour peindre l’intérieur du rectangle.

rect

Référence au rectangle à remplir.

Valeur retournée

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

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

   // Create a SolidBrush object.
   SolidBrush blackBrush(Color(255, 0, 0, 0));

   // Create a RectF object.
   RectF fillRect(1.0f, 2.5f, 100.3f, 100.9f);

   // Fill the rectangle.
   graphics.FillRectangle(&blackBrush, fillRect);
}

Configuration requise

Condition requise Valeur
En-tête gdiplusgraphics.h

Voir aussi

Graphismes

Color

Rect

StringFormat