Graphics ::FillPolygon(constBrush*,constPointF*,INT) method (gdiplusgraphics.h)

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

Syntaxe

Status FillPolygon(
  const Brush  *brush,
  const PointF *points,
  INT          count
);

Paramètres

brush

Pointeur vers un objet Brush utilisé pour peindre l’intérieur du polygone.

points

Pointeur vers un tableau de points qui composent les sommets du polygone. Les deux premiers points du tableau spécifient le premier côté du polygone. Chaque point supplémentaire spécifie un nouveau côté, dont les sommets incluent le point et le point précédent. Si le dernier point et le premier point ne coïncident pas, ils spécifient le dernier côté du polygone.

count

Entier qui spécifie le nombre de points dans le tableau de points .

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

L’exemple suivant définit un polygone, puis le remplit.

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

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

   // Create an array of PointF objects that define the polygon.
   PointF point1(100.0f, 100.0f);
   PointF point2(200.0f, 130.0f);
   PointF point3(150.0f, 200.0f);
   PointF point4(50.0f, 200.0f);
   PointF point5(0.0f, 130.0f);
   PointF points[5] = {point1, point2, point3, point4, point5};

   // Fill the polygon.
   graphics.FillPolygon(&blackBrush, points, 5);
}

Configuration requise

Condition requise Valeur
En-tête gdiplusgraphics.h

Voir aussi

Graphismes

StringFormat