开发者

WPF rendering without graphic card

开发者 https://www.devze.com 2023-01-12 15:15 出处:网络
I have a WPF application that runs as a service and renders 2D graphical elements to take jpg snapshots. All this happens without any Window or visible control.

I have a WPF application that runs as a service and renders 2D graphical elements to take jpg snapshots. All this happens without any Window or visible control.

The application typically runs on servers with very crappy video adapters: does this have a negative impact on the application's performance?

Is there a way I can tell WPF/.NET to ignore 开发者_JAVA百科the video adapter for rendering so that I can make some direct comparison tests on the same machine?


I found the answer. For future reference:

Session0 isolation is preventing services to make use of hardware acceleration (in WPF but also in anything else) starting from Windows Vista/2008. You can read more here: http://www.microsoft.com/whdc/system/sysinternals/session0changes.mspx

If you are running XP or 2003, services can run in an interactive session that loads the video drivers: if you check the option "allow service to interact with desktop" then hardware acceleration is used (you get rendering tier 2 provided that your hardware supports it), otherwise you get rendering tier 0 (software only).

Please beware that if you connect with remote desktop and start the service, the service will use that session (which is NOT accelerated) and will run in rendering tier 0.

(obviously this means that in Vista/7/2008 and later you can run the service with a crappy video adapter without any consequence)

0

精彩评论

暂无评论...
验证码 换一张
取 消