如何在 WPF 中禁用硬件加速?
在 WPF 中禁用硬件加速的步骤是什么?到底是什么?它是 Windows 设置、Visual Studio 设置还是您在 WPF 项目代码中更改的内容?它只会影响您正在运行的程序还是会影响整个系统?
What is the procedure for disabling hardware acceleration in WPF? What is it exactly? Is it a Windows setting, a Visual Studio setting, or something you alter in the code of your WPF project? Will it affect only the program you're running or will it be system-wide?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从 .Net 3.5 SP1 开始,您可以在
Window
级别禁用它。或者您可以订阅窗口的
SourceInitialized
事件并执行相同的操作。或者,您可以在进程级别设置:
优先顺序对于软件渲染是:
You can disable it on a
Window
level starting from .Net 3.5 SP1.or you can subscribe to
SourceInitialized
event of the window and do the same.Alternatively you can set it on Process level:
The precedence order for software rendering is:
它是机器范围的注册表设置。请参阅图形渲染注册表设置在 WPF 文档中了解注册表项以及与自定义 WPF 呈现相关的其他详细信息。
列出的关键是:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration
MSDN 文档对于 .NET 4.5“不可用”,因此这可能是一个仅适用于 4.0 或更低版本的已弃用选项。
It is a machine-wide registry setting. See Graphics Rendering Registry Settings in the WPF docs for the registry key and other details relating to customizing WPF rendering.
The key listed is:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration
The MSDN document is "not available" for .NET 4.5, so this may be a depricated option that only works in 4.0 or below.
在版本 4.0 中,您还可以使用 RenderOptions.ProcessRenderMode 来设置进程范围首选项 (http://msdn.microsoft.com/en-us/library/system.windows.media.renderoptions.processrendermode.aspx)。
In version 4.0, you can also use
RenderOptions.ProcessRenderMode
to set a process wide preference (http://msdn.microsoft.com/en-us/library/system.windows.media.renderoptions.processrendermode.aspx).您还可以通过在 MainWindow 中添加以下代码来禁用 WPF 应用程序中的硬件加速。
这解决了我的 TeamViewer 问题。
来源:
如何在 wpf 中禁用硬件加速?
You can also disble hardware acceleration in WPF App by adding in MainWindow the following code.
This solved my issue with TeamViewer.
Source:
How does one disable hardware acceleration in wpf?
这是系统范围的设置,从桌面右键单击弹出菜单,单击属性,然后在其中查找视频设置以禁用硬件加速,或者可能有一个用于图形设置的系统托盘图标。这是系统范围的而不是本地的。
That is a system wide setting, from the desktop, right click to bring up a popup menu, click on properties, and look around in there for the video settings to disable Hardware acceleration or that there may be a system tray icon for the graphics settings. This is system wide and not local.