当 Window AllowsTransparency = true 时,WPF 硬件加速了吗? [英] Is WPF Hardware-accelerated when Window AllowsTransparency = true?

查看:27
本文介绍了当 Window AllowsTransparency = true 时,WPF 硬件加速了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在考虑在 WPF 中制作自己的窗口框架,类似于 Visual Studio.我已经读过设置 AllowsTransparency = true 会强制 WPF 在软件模式下呈现.这个例子是我困惑的根源(重点是我的),它指出:

I have been looking at making my own window frame in WPF, similar to Visual Studio. I have read that setting AllowsTransparency = true would force WPF to render in software-mode. This example is the source of my confusion (emphasis mine), which states:

WPF 窗口的完全自定义只有在 AllowsTransparency 设置为True"时才能完成,这会导致窗口是软件渲染的,GPU 渲染速度可能没有那么快.

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(带有自定义框架和透明边框模糊)会是软件渲染的.

However, I've read elsewhere that with window layering you can have hardware-acceleration and this is what WPF does. I also find it hard to imagine that Visual Studio 2013 -with its custom frame and transparent border blur- would be software-rendered.

这个问题是否有明确的答案(假设 Windows 7 起),当 Window AllowsTransparency 为 true 时,WPF 是否硬件加速?

Is there a definitive answer to the question (assuming Windows 7 onwards), Is WPF Hardware-accelerated when Window AllowsTransparency is true?

推荐答案

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

It seems that transparent windows (AllowsTransparency = true) are hardware accelerated for Windows Vista and upper: HW Acceleration of Layered Windows

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

There is also an hotfix to make it work under windows XP as well: http://support.microsoft.com/kb/937106/en-us

这篇关于当 Window AllowsTransparency = true 时,WPF 硬件加速了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆