0

Hi i wanted to create the acrylic blur effect provided by Microsoft for my WPF Application. I have tried many ways such as using DWM Blur Behind,DwmSetWindowAttribute etc.. but since these methods are not much effective i would like to bring the acrylic blur effect using direct2d (The methods used in UWP by using win2d) gaussian blur method mentioned here:

Gaussian blur effect - Win32 apps | Microsoft Docs

since i'm a newbie to DirectX,i need help.

trickymind
  • 557
  • 5
  • 21

1 Answers1

0

WPF effects can be applied to any UIelement.

https://learn.microsoft.com/en-us/dotnet/api/system.windows.uielement.effect?view=netcore-3.1

A window is a uielement. Notice the inheritance chain:

https://learn.microsoft.com/en-us/dotnet/api/system.windows.window?view=netcore-3.1

You can therefore do:

    Title="MainWindow" >
<Window.Effect>
    <BlurEffect KernelType="Gaussian" Radius="20" />
</Window.Effect>

The effect is not applied to window chrome.

If you want window chrome to be blurred then you would have to provide custom window chrome of your own.

How to create custom window chrome in wpf?

If you don't need window chrome at all you could set the windowstyle to none.

Andy
  • 11,864
  • 2
  • 17
  • 20
  • i already have a transparent window which i created using setWindowCompositionAttribute() -- AccentState-Invalid when i applied the blur effect it only affects the child elements which are opaque. what i need is to make the whole window to blur (more blur radius than DWM Blur) – trickymind Jul 19 '20 at 12:02