I am aware that similar questions have been asked and answered. Mine, however, is a three-part question.
For the purposes of this question, keep the following in mind:
- I am an amateur, early college undergraduate studying Computer Science. I am highly unskilled in complex programming, but I can understand most terminology.
- This is a WPF project created in Visual Studio using VB.NET, but I can read C# just as easily due to the languages’ similarity.
- This is my first time experimenting with any DWM APIs.
1. Applying Aero Glass to Borderless Window
First and foremost, is it possible to use the glass effect in the background of a borderless window? If so (and I believe it to be), how is this done?
Additionally, since Windows 8 and newer no longer use the translucent glass effect, can this still be done on those operating systems?
2. Keeping Native Blur Effect without Glass
I want the smooth native DWM blur effect, but I don’t want the glossy glass overlay, and I don’t want the window color predefined in the user’s theme settings.
3. Customizing Blur Radius and Location
Is it possible to only apply this effect to a certain portion of the window? More importantly, is it possible to adjust the intensity (radius) of the blurring effect?
EDIT – Screenshot Examples
By request, I have posted some examples of the effect I wish to achieve.
The image above is an actual screenshot of my WPF application (still in the works). Its minimalist design relies heavily on animation of movement and window resizing.
Using some photoshop skills, I’ve rendered the image above, demonstrating the effect I want to create, exactly the way I want it. Note the following:
- The blur has a much higher radius (intensity) than usual Aero blurring effects
- The blur is only visible on one portion of the windows
- The blur does not inherit its color from the green color theme of the desktop
2
Answers
1. Applying Aero Glass to Borderless Window
Since what you are trying to achieve is not so much a glass effect but more of a transparent+blur you can use the following methods to blur behind the window.
Windows 7: you can use DwmEnableBlurBehindWindow to blur behind the window.
Window 8: I havn’t found a workable solution since DwmEnableBlurBehindWindow was removed in Windows 8.
Windows 10: you can use SetWindowCompositionAttribute to blur behind the window.
2. Keeping Native Blur Effect without Glass
The above solutions will only apply a blur effect behind the window, it will be up to the window to define transparency and colour.
3. Customizing Blur Radius and Location
With these approaches you can only blur underneath the entire window, and it will be up to you to use an alpha channel on portions of the window you want to be transparent. I don’t think you can define the blur radius either.
My Excuse
Pardon my inexperience with Stackoverflow but I thought I would try and help you out a little.
By following the link posted by Tom I was able to come across this block of code (originally in c#). So seen as how this code isn’t readily availible to most people, here it is:
Result
Once implemented, this will effect the whole Window as shown:
After a little tweaking
After about 5 mins of trying to copy your design I came up with this:
XAML
I’m sure you could do a better job of the design than I have. It is possible to change the blend colour simply by adjusting the background colour (on the window), and the opacity level can also be changed. The XAML of my design is as follows:
I hope this helps!