更改窗户的Aero玻璃的颜色?

编程入门 行业动态 更新时间:2024-10-19 20:20:47
本文介绍了更改窗户的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 创建不规则形状的窗口可以正常工作,但看起来不像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玻璃的颜色?

本文发布于:2023-11-12 03:59:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580456.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗户   颜色   玻璃   Aero

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!