Gdi+ GDI+;:为什么FillRectangle在玻璃上是透明的,而FillEllipse是不透明的?

Gdi+ GDI+;:为什么FillRectangle在玻璃上是透明的,而FillEllipse是不透明的?,gdi+,aero,dwm,Gdi+,Aero,Dwm,我正在玻璃上画一个长方形和一个椭圆 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

我正在玻璃上画一个长方形和一个椭圆

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);

结论:为什么:

  • 使用不透明颜色填充椭圆
    绘制不透明
  • FillRectangle
    使用不透明颜色绘制部分透明
注意:这个问题几乎是重复的。 除了这个问题集中在
FillRectangle
FillEllipse
-鉴于 处理*如何绘制不透明颜色 在玻璃上

另见

您解决了这个问题吗?我也得到了同样的结果。