Create translucent blurry WPF background

I have a border, I want the background of this border to be partially transparent (opacity 0.8), but I do not want the image behind it to be clearly defined. The effect that I get is similar to the effect of the border of a Windows Vista window, where you can see that something is behind it, but you cannot say what it is.

A few clarifications:
I am working on Windows XP, so I can not use Vista Glass
I need this solution to be portable on any Windows platform.

Any help would be appreciated :)

+4
source share
3 answers

Extend glass frame in WPF application

WPF window with aero glass background. (C # .NET)

DWM Blur Behind Overview

Hope one of these links helps. I used the 1st link that I had to add to this class to make it work:

#region WINAPI Crap, none should handle this in 21st century private class NonClientRegionAPI { [StructLayout(LayoutKind.Sequential)] public struct MARGINS { public int cxLeftWidth; // width of left border that retains its size public int cxRightWidth; // width of right border that retains its size public int cyTopHeight; // height of top border that retains its size public int cyBottomHeight; // height of bottom border that retains its size }; [DllImport("DwmApi.dll")] public static extern int DwmExtendFrameIntoClientArea( IntPtr hwnd, ref MARGINS pMarInset); } #endregion 
+2
source

This is the best I could find on the net:

http://blogs.msdn.com/unnir/archive/2006/03/01/541154.aspx

Given the above, Microsoft guy, it will be difficult for you to find a better way to do this.

It makes simple transparency in the window, so it doesn't quite look like Aero glass. The Aero effect is hardware accelerated and certainly uses Direct3D in some way.

This SO answer talks about this in detail:

Is it possible to achieve aero glass look at XP?

+1
source

Silverlight has a Blur effect ( http://www.silverlightshow.net/tips/Using-Blur-and-DropShadow-effects-in-Silverlight-3.aspx ) should also be available for WPF ( http: //searchwindevelopment.techtarget .com / tip / 0,289483, sid8_gci1377157,00.html ) you can apply to controls. Maybe combining this with opacity will help you achieve your desired goal?

0
source

Source: https://habr.com/ru/post/1309075/


All Articles