模糊背后的透明窗口WPF [英] Blur behind transparent WPF window
问题描述
我想创建与模糊其背后的背景半透明边框少的窗口WPF应用程序。
I am trying to create a WPF application with a semi transparent border-less window that blurs the background behind it.
下面是我想要的一个例子做。 截图
Here is an example of what I want to do. Screenshot
我曾尝试使用 DwmEnableBlurBehindWindow
仅在Windows上运行Vista / 7的。
I have tried to use DwmEnableBlurBehindWindow
which works only on windows Vista/7.
我试图找到一个解决办法,将工作在Windows 7,8和10。
I am trying to find a solution that will work on Windows 7, 8 and 10.
推荐答案
有关有兴趣的人,我发现为Windows 10的解决方案,它看起来好像是不是可能在Windows 8中,像大卫赫弗南提到,DwmEnableBlurBehindWindow从Windows 8中删除,但是微软再次推出了为实现在Windows 10这样的效果的解决方案。
For anyone interested I have found a solution for Windows 10, It looks as though it isn't possible on Windows 8, like David Heffernan mentioned, DwmEnableBlurBehindWindow was removed from Windows 8, however Microsoft re-introduced a solution for achieving this effect in Windows 10.
- 视窗10:解决方案使用
SetWindowCompositionAttribute - Windows 8的:无解
- Windows 7的:你可以继续使用DwmEnableBlurBehindWindow
这篇关于模糊背后的透明窗口WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!