最快速的方法来捕捉游戏画面截图在C#中?(更多than20每秒图像) [英] fastest method to capture game screen shots in c#?(more than20 images per second)

查看:1287
本文介绍了最快速的方法来捕捉游戏画面截图在C#中?(更多than20每秒图像)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能让screenshoots到整个游戏画面非常快?类似的财产以后20-30每秒?(我想将它们转换为视频)

How can i make screenshoots to the entire game screen very fast? Somthing like 20-30 per second?(i want to convert them to video)

[[1]]
我已经试过WMEncoder.Results分别是WMEncoder只能使用一组预先编解码器的视频格式(WMA)捕获屏幕和屏幕区域。 (29 fps的最佳编码结果).WMEncoder不能进行截图

[[1]] I've tried WMEncoder.Results were that WMEncoder can capture the screen and regions of screen only in a video format (wma) using a set of preconfigured codecs. (29 fps best encode result).WMEncoder can not make screenshots.

[[2]]
我已经试过的DirectX:

[[2]] I've tried DirectX :

Surface s = device.CreateOffscreenPlainSurface(
Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height,
Format.A8R8G8B8, Pool.SystemMemory);
device.GetFrontBufferData(0, s);
SurfaceLoader.Save("c:\\Screenshot"+i.ToString()+".bmp", ImageFileFormat.Bmp, s);

这就像GDI ..very慢....而且它只能在DirectX 1.0,因为SurfaceLoader在DirectX 2.0不存在

This works like gdi ..very slow....and it works only in DirectX 1.0 because SurfaceLoader does not exist in directX 2.0

这是我在一些岗位读过的另一种方法是使用:

Another way that i've read in some post is using :

s = device.GetBackBuffer(0, 0, Microsoft.DirectX.Direct3D.BackBufferType.Mono);



,但这MAKS截图只对CURENT窗口。

, but this maks screenshots only to the curent window.

[[3]]
我试图用Taksi(在sourceforge.net)...但我不知道如何在C#中使用它,使其发挥作用。

[[3]] I've tried to use Taksi (at sourceforge.net)... but i don't know how to use it in c# and make it work.

请帮我...

推荐答案

您真的要挂接到DirectX的,所以你可以,如果你是那场比赛/应用程序打的电话。以下是这样做的几个网站(大多数抽取多余的东西,但我不明白为什么你不能保存后备缓冲每x帧):

You really want to hook into directx so you can make the calls as if you were that game/application. Below are a few sites that do this (most draw extra things, but i don't see why you couldn't save the backbuffer every x frames):

<一个HREF =htt​​p://www.ring3circus.com/downloads/direct3d-hooking/相对=nofollow> http://www.ring3circus.com/downloads/direct3d-hooking/

HTTP:// WWW .gamedev.net /主题/ 359794-C-Direct3D的挂钩采样/

Disclamer:我没有尝试过这一点,所以不知道FPS你可以得到,但我认为这是最快的方法你有效地从游戏中做这件事。

Disclamer: I've not tried this, so not sure what FPS you can get, however i would think this is the fastest method as you're doing it effectively from within the game.

这篇关于最快速的方法来捕捉游戏画面截图在C#中?(更多than20每秒图像)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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