I’m new to C++. I am using Visual studio Professional 2010. I learned to draw lines, but I need to draw filled polygon this time. The way that I drew lines is below:
private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
Graphics ^g = e->Graphics; //require for drawing
g->DrawArc(Pens::Black, i-the_size/2, j-the_size/2, the_size, the_size, 0, 90 );
g->DrawArc(Pens::Black, i+the_size/2, j+the_size/2, the_size, the_size, 180, 90 );}
How can I draw filled polygons using techniques similar to what I have learned so far?
Call
Graphics.FillPolygon(). You will need a brush rather than a pen and you must put your points into a point arrayPoint[].The sample code from MSDN is like this: