Aero: How to draw solid (opaque) colors on glass?

前端 未结 6 829
孤独总比滥情好
孤独总比滥情好 2020-11-30 03:02

Using GDI+ to draw various colors:

brush = new SolidBrush(color);
graphics.FillRectangle(brush, x, y, width, height);

You\'ll notice that n

6条回答
  •  不知归路
    2020-11-30 03:56

    Another day, another solution by me.

    • Draw everything you want to appear on glass into a bitmap.
    • Then, clear the form background with black color.
    • Immediately after this, draw the bitmap on your form.

    However (as with any other solution not using DrawThemeTextEx): Text rendering will not work correctly, because it always takes the back color of your form as an antialias/cleartype hint. Use DrawThemeTextEx instead, which also supports text with a glow effect behind.

提交回复
热议问题