C#捕获直接3D屏幕 [英] C# Capturing Direct 3D Screen

查看:104
本文介绍了C#捕获直接3D屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一段时间以来我一直在愚弄屏幕捕获,我设法捕获了整个屏幕,屏幕上的某些区域等等...

I have been fooling around with screen capture for awhile now and I managed to capture the entire screen, certain areas on the screen etc...

但是当我进入游戏并尝试捕获屏幕,它完全忽略了游戏,而是捕获了桌面(或游戏窗口后面的任何内容)。
另一个有趣的事实是PrtScn按钮也会发生同样的事情。

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?

推荐答案

您正在使用的屏幕捕获技术可以很好地捕获非硬件加速的内容。我怀疑您尝试在Windows Media Player中捕获电影帧时也会遇到相同的问题。

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.

解决方案是使用DirectX从硬件本身进行屏幕捕获。 本文说明了如何使用一些代码和托管包装器在DirectX周围称为 SlimDX

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.

编辑
如果Slim DX对您不起作用,那么您只需要在Direct X周围找到另一个托管包装即可。我认为您不进行以下操作就无法进行屏幕捕获:硬件级别,而DirectX是在Windows平台上做到这一点的方法。

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.

这篇关于C#捕获直接3D屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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