如何解决包含非 XOR方式的多边形的 FillPath 联合
我需要用抗锯齿填充复杂区域。
该区域由许多旋转的矩形(如向日葵花瓣)和一个中心圆组成。
区域不支持抗锯齿
所以我尝试了 FillPath 但没有填充矩形重叠的区域。 (异或)
// Has alpha so FillPath-ing multiple times doesn't help
Color color = Color.FromArgb(128,32,64,255);
Brush brush = new SolidBrush(color);
Region region = null;
//GraphicsPath bigPath = new GraphicsPath();
for (int i = 0; i < nPetals; i++)
{
GraphicsPath pat = new GraphicsPath();
Point p1,p2,p3,p4; // Actual code omitted
pat.Addpolygon(new[] { p1,p4 });
//bigPath.Addpolygon(new[] { p1,p4 });
if (region == null)
region = new Region(pat);
else region.Union(pat);
}
var pathCirc = new GraphicsPath();
pathCirc.AddEllipse(100,200,3,3);
region.Union(path);
g.FillRegion(brush,region); //Aliased
//g.FillPath(brush,bigPath); //XOR'ed
GraphicsPath.Addpolygon/AddEllipse() 有没有什么非 XOR 的方法?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。