我有一个panel
,我在上面画了一颗心panel
。但我不想画心,我想画除了心之外的所有东西,所以心是透明的。我可以将Region
所选内容反转Path
吗?
System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddArc(0, 0, (this.Width / 2), (this.Height / 2), 135, 195);
path.AddArc((this.Width / 2), 0, (this.Width / 2), (this.Height / 2), 210, 195);
path.AddLine((this.Width / 2), this.Height, (this.Width / 2), this.Height);
this.Region = new Region(path);
this.BackColor = Color.Black;
它看起来像什么(白色=透明):
我希望它看起来像什么(白色=透明):