我有一个边框,我希望这个边框的背景是部分透明的(不透明度 0.8),但我不希望它后面的图像被很好地定义。我所追求的效果类似于 Windows Vista 窗口边框效果,您可以看到它背后有什么东西,但您无法分辨它是什么。
几点说明:
我在 Windows XP 上工作,所以我不能使用 Vista Glass
我需要这个解决方案可以在任何 Windows 平台上移植
任何帮助,将不胜感激 :)
最佳答案
Extend Glass Frame Into a WPF Application
WPF Window with aero glass background. (C# .NET)
DWM Blur Behind Overview
希望这些链接之一有帮助。我使用了第一个链接,我必须添加这个类才能使其工作:
#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
关于wpf - 创建半透明模糊背景 WPF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2786336/