#include// Assume dc is a valid wxDC object wxPoint points[] = { wxPoint(10,10), wxPoint(50,60), wxPoint(90,10) }; int num_points = 3; // Draw the polygon dc.DrawPolygon(num_points, points);
#includeIn this example, we define an array of three wxPoint objects that define the vertices of a triangle, and then set the brush of the wxDC object to a solid red color. Finally, we call the DrawPolygon method of the wxDC object with the fill parameter set to true to draw the filled triangle. The examples illustrate the use of the DrawPolygon method, which is part of the wxWidgets C++ library.// Assume dc is a valid wxDC object wxPoint points[] = { wxPoint(10,10), wxPoint(50,60), wxPoint(90,10) }; int num_points = 3; // Draw the filled polygon dc.SetBrush(wxBrush(wxColour(255,0,0), wxBRUSHSTYLE_SOLID)); dc.DrawPolygon(num_points, points, wxODDEVEN_RULE);