Reputation: 1762
Within the System.Drawing.Graphics namespace you can draw a polygon like this:
using (Graphics g = Graphics.FromImage(bmp))
{
g.DrawPolygon(Pens.Black, myArray);
}
and there is a method to create a filled polygon g.FillPolygon()
.
How can you create a polygon (so it has a border) and then fill it?
Upvotes: 2
Views: 9523
Reputation: 4749
Just draw the filled polygon then draw the perimeter so it looks like it has a border:
using (Graphics g = Graphics.FromImage(bmp))
{
g.FillPolygon(fillBrush, myArray);
g.DrawPolygon(borderPen, myArray);
}
Upvotes: 6