【发布时间】:2015-05-11 20:21:38
【问题描述】:
以下代码画了一个十字:
using (SolidBrush brush = new SolidBrush(Color.FromArgb(192, 99, 104, 113)))
{
using(GraphicsPath path = new GraphicsPath())
{
path.AddRectangle(new Rectangle(e.ClipRectangle.X + (e.ClipRectangle.Width - 40) / 2, e.ClipRectangle.Y, 40, e.ClipRectangle.Height));
path.AddRectangle(new Rectangle(e.ClipRectangle.X, e.ClipRectangle.Y + (e.ClipRectangle.Height - 40) / 2, e.ClipRectangle.Width, 40));
path.FillMode = FillMode.Winding;
e.Graphics.DrawPath(Pens.DimGray, path);
}
}
我想画成这样:
我尝试过使用Flatten(); 和CloseAllFigures();,但这些都不起作用。
我正在寻找类似 Union 的效果:
GraphicsPath 可以做到这一点吗?
【问题讨论】:
标签: c# .net gdi+ gdi graphicspath