c# - 当 Window AllowsTransparency = true 时 WPF 硬件加速了吗?

标签 c# .net wpf .net-4.5

我一直在考虑在 WPF 中制作我自己的窗口框架,类似于 Visual Studio。我读过设置 AllowsTransparency = true 会强制 WPF 在软件模式下呈现。 This example是我困惑的根源(强调我的),其中指出:

Complete customization of WPF window can be done only when AllowsTransparency is set to "True", which causes that the window is software rendered which might be not as fast GPU rendering.

但是,我在别处读到,通过窗口分层,您可以获得硬件加速,而这正是 WPF 所做的。我还发现很难想象 Visual Studio 2013 - 具有自定义框架和透明边框模糊 - 会被软件渲染。

这个问题是否有明确的答案(假设 Windows 7 及更高版本),当 Window AllowsTransparency 为真时 WPF 硬件加速了吗?

最佳答案

似乎透明窗口 (AllowsTransparency = true) 是针对 Windows Vista 及更高版本的硬件加速:HW Acceleration of Layered Windows

还有一个修补程序可以使其在 Windows XP 下也能正常工作:http://support.microsoft.com/kb/937106/en-us

关于c# - 当 Window AllowsTransparency = true 时 WPF 硬件加速了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21576016/

相关文章:

c# - 在VBA中编译支持声明函数的dll

c# - 在代码隐藏 asp.net 中默认选中的复选框列表项

.net - 无法从控制更改控制可见性

c# - WPF RichTextBox 滚动到 TextPointer

wpf - 调用 XamlReader.Load 时抛出 XamlParseException

c# - 通过限制迭代次数判断一个数是否为素数-c#

c# - 有多个 DoWorkEventHandlers 是不好的做法吗?

c# - 将 JSON 对象转换为 Data.Entities.Models.MyModel

.net - 在 Windows Mobile 6.5 中禁用菜单栏

c# - 添加 View 模型时命名空间错误