Graphics::D rawPolygon(constPen*,constPoint*,INT) méthode (gdiplusgraphics.h)
La méthode Graphics::D rawPolygon dessine un polygone.
Syntaxe
Status DrawPolygon(
[in] const Pen *pen,
[in] const Point *points,
[in] INT count
);
Paramètres
[in] pen
Type : stylet* const
Pointeur vers un stylet utilisé pour dessiner le polygone.
[in] points
Pointeur vers un tableau d’objets Point qui spécifient les sommets du polygone.
[in] count
Type : INT*
Entier qui spécifie le nombre d’éléments dans le tableau de points .
Valeur retournée
Type : État
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
Si la première et la dernière coordonnées du tableau de points ne sont pas identiques, une ligne est dessinée entre elles pour fermer le polygone.
Exemples
L’exemple suivant dessine un polygone, défini par un tableau de points.
VOID Example_DrawPolygon(HDC hdc)
{
Graphics graphics(hdc);
// Create a Pen object.
Pen blackPen(Color(255, 0, 0, 0), 3);
// Create an array of Point objects that define the polygon.
Point point1(100, 100);
Point point2(200, 130);
Point point3(150, 200);
Point point4(50, 200);
Point point5(0, 130);
Point points[5] = {point1, point2, point3, point4, point5};
Point* pPoints = points;
// Draw the polygon.
graphics.DrawPolygon(&blackPen, pPoints, 5);
}
Configuration requise
Client minimal pris en charge | Windows XP, Windows 2000 Professionnel [applications de bureau uniquement] |
Serveur minimal pris en charge | Windows 2000 Server [applications de bureau uniquement] |
Plateforme cible | Windows |
En-tête | gdiplusgraphics.h (inclure Gdiplus.h) |
Bibliothèque | Gdiplus.lib |
DLL | Gdiplus.dll |