简体   繁体   English

带阴影和模糊的无边界窗口

[英]Borderless window with shadow and blurbehind

I tried SetWindowCompositionAttribute solution, and it worked well, but no shadows. 我尝试了SetWindowCompositionAttribute解决方案,但效果很好,但是没有阴影。
I tried combine blurbehind + apply shadow on window with DropShadow for WPF Borderless Window but here i got issue with unfocus/focus window lost transparancy. 我试着结合模糊与在WPF无边界窗口上使用DropShadow在窗口上应用阴影和DropShadow,但是在这里我遇到了问题,即散焦/聚焦窗口失去了透明度。
Is it possible to make borderless window with blurbehind + shadow (and some close/min/max)? 是否可以使无边界窗口具有模糊+阴影(以及一些关闭/最小/最大)值?
Example: AMD Radeon Settings. 示例:AMD Radeon设置。 Is it wpf? 是wpf吗? Or custom c++ solution. 或自定义c ++解决方案。

var accent = new AccentPolicy()
{
  AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND,
  AccentFlags = 0x20 | 0x40 | 0x80 | 0x100,
};

the set Value of AccentFlags will give your window a dropshadow effect like menu and calendar of Windows 10 does 设置的AccentFlags值将使您的窗口具有阴影效果,就像Windows 10的菜单和日历一样 在此处输入图片说明

在此处输入图片说明

I know how to do this in XAML, it's probably best to have all visual code in XAMl and logical code in C#. 我知道如何在XAML中执行此操作,最好将所有可视代码包含在XAMl中,并将逻辑代码包含在C#中。

Code: 码:

//Set BorderThickness to 0 for no boreder //play with DropDownShadowEffect //将BorderThickness设置为0,以确保无聊//使用DropDownShadowEffect

 <Border BorderBrush="color" BorderThickness="0" >
      <Border.Effect>
         <DropShadowEffect BlurRadius="10" Color="black" Direction="235" Opacity=".3" RenderingBias="Performance"  ShadowDepth="4" />
      </Border.Effect>
 </Border>

hope that is what you are looking for 希望那是你想要的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM