brush = new SolidBrush(0xFF000000); //solid (i.e. non-opaque) black
graphics.FillRectangle(brush, x, y, 30, 30);
graphics.FillEllipse(brush, x+33, y-15, 30, 30);
这里发生了什么?
您可以看到同样适用于其他颜色:
brush = new SolidBrush(0xFFff0000); //solid (i.e. non-opaque) red
graphics.FillRectangle(brush, x, y, 30, 30);
graphics.FillEllipse(brush, x, y+33, 30, 30);
brush = new SolidBrush(0xFF00ff00); //solid (i.e. non-opaque) green
graphics.FillRectangle(brush, x, y, 30, 30);
graphics.FillEllipse(brush, x, y+33, 30, 30);
brush = new SolidBrush(0xFF0000ff); //solid (i.e. non-opaque) blue
graphics.FillRectangle(brush, x, y, 30, 30);
graphics.FillEllipse(brush, x, y+33, 30, 30);
brush = new SolidBrush(0xFFffffff); //solid (i.e. non-opaque) white
graphics.FillRectangle(brush, x, y, 30, 30);
graphics.FillEllipse(brush, x, y+33, 30, 30);
结论:为什么:
FillEllipse
使用不透明颜色绘制不透明FillRectangle
使用不透明的颜色绘制部分透明注意:此问题几乎与my other question重复。 除了这个问题侧重于
FillRectangle
和之间的差异FillEllipse
- 而那个问题 处理*如何绘制不透明的颜色 在玻璃上。