开发者

C# Capturing Direct 3D Screen

开发者 https://www.devze.com 2023-03-09 01:03 出处:网络
I have been fooling around with screen capture for awhi开发者_运维技巧le now and I managed to capture the entire screen, certain areas on the screen etc...

I have been fooling around with screen capture for awhi开发者_运维技巧le now and I managed to capture the entire screen, certain areas on the screen etc...

But when I go into a game and try to capture the screen, it completely ignores the game and instead, captures the desktop (or whatever is behind the game window). Another interesting fact is that the same thing happens with the PrtScn button.

Any ideas on how to capture a game's screen?


The screen capturing technique you are using works well for capturing things that aren't hardware accelerated. I suspect you'd have the same problem trying to capture a movie frame in Windows Media Player.

The solution is the do a screen capture from the hardware itself using DirectX. This article explains how to do that with some code and a managed wrapper around DirectX called SlimDX.

EDIT If Slim DX doesn't work for you, then you'd just have to find another managed wrapper around Direct X. I don't think you are going to be able to do the screen capture without working at the hardware level, and DirectX is the means of doing that on the Windows platform.

0

精彩评论

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