更改窗户的Aero玻璃的颜色? [英] Changing the colour of Aero glass for my window?

查看:204
本文介绍了更改窗户的Aero玻璃的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 DwmExtendFrameIntoClientArea WPF应用程序可获得玻璃效果。一切正常。我想做的是更改玻璃的颜色-我正在编写一个倒数计时器,我希望窗口在大多数情况下是正常的玻璃颜色,然后变成红色(但是

I'm using DwmExtendFrameIntoClientArea in my WPF application to get the glass effect. This is working fine. What I'd like to do is change the colour used for the glass -- I'm writing a countdown timer, and I'd like the window to be the normal glass colour most of the time, and then to go red (but still with glass) when the time runs out.

我发现这个问题,它讨论了如何应用渐变玻璃,效果很好当选择其他颜色时。不幸的是,边框的颜色不正确。

I found this question, which talks about how to apply a gradient glass, and that works fine when picking a different colour. Unfortunately, the borders are not coloured appropriately.

当我通过使用 ResizeMode = NoResize 关闭边框时,然后我遇到了四角。我想保留圆角。

When I turn off the borders by using ResizeMode="NoResize", then I end up with square corners. I'd like to keep the rounded corners.

我看过通过使用 AllowTransparency = True 创建不规则形状的窗口 code>可以正常工作,但看起来不像Aero玻璃窗口。

I looked at creating an irregularly-shaped window, by using AllowTransparency="True" and that works fine, but doesn't look like an Aero glass window. It looks a bit flat.

所以:我的问题:如何在WPF中创建一个看起来像Aero玻璃透明性但使用不同颜色的窗口?

So: my question: how do I create a window in WPF that looks like Aero glass transparency, but uses a different colour?

推荐答案

我认为实现此目的的唯一可能方法是使用半透明的填充边框并将其绘制在整个窗口或部分区域上你拿到杯子了。一种解决方法,但是我想这是一个可能的解决方案,因为玻璃的颜色由系统用户定义,并且此设置会覆盖您的玻璃。

I think the only possible way to achieve this is to use a semi-transparent filled border and draw it over the entire window or the part you got the glass. Its a workaround but I guess it's a possible solution since the color of the glass gets defined by the system-user and this setting would overwrite yours.

这篇关于更改窗户的Aero玻璃的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆