Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 System.Drawing.Graphics 命名空间中,您可以像这样绘制多边形:
using (Graphics g = Graphics.FromImage(bmp)) { g.DrawPolygon(Pens.Black, myArray); }
并且有一种创建填充多边形的方法g.FillPolygon()。
g.FillPolygon()
你如何创建一个多边形(所以它有一个边框)然后填充它?
只需绘制填充的多边形,然后绘制周长,使其看起来像有边框:
using (Graphics g = Graphics.FromImage(bmp)) { g.FillPolygon(fillBrush, myArray); g.DrawPolygon(borderPen, myArray); }