【发布时间】:2020-11-18 02:00:13
【问题描述】:
我有一个panel,我在那个panel 上画了一颗心。
但我不想画心我想画除了心之外的一切,所以心是透明的。
我可以反转从Path 中选择的Region 吗?
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;
长什么样子(白色=透明):
我希望它看起来像什么(白色 = 透明):
【问题讨论】: