拍摄DirectX全屏应用程序的屏幕截图 [英] Take screenshot of DirectX full-screen application

查看:76
本文介绍了拍摄DirectX全屏应用程序的屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让我感到困惑。 DirectX绕过了所有内容并直接与设备驱动程序进行通信,因此GDI和其他常用方法将不起作用-除非禁用了Aero(或无法使用Aero),否则出现的所有内容都是屏幕左上方的黑色矩形。我已经尝试了其他人在几个论坛上提出的建议,使用DirectX获取并保存了后台缓冲区,但是得到了相同的结果:

This boggles me. DirectX bypasses everything and talks directly to the device driver, thus GDI and other usual methods won't work - unless Aero is disabled (or unavailable), all that appears is a black rectangle at the top left of the screen. I have tried what other have suggested on several forums, using DirectX to get the back buffer and save it, but I get the same result:

device-> GetFrontBufferData(0 ,表面);
D3DXSaveSurfaceToFile( fileName,D3DXIFF_BMP,surface,NULL,NULL);

device->GetFrontBufferData(0, surface); D3DXSaveSurfaceToFile("fileName", D3DXIFF_BMP, surface, NULL, NULL);

有什么方法可以在获取其他全屏DirectX应用程序的屏幕快照时启用了Aero吗?

Is there any way to get a screenshot of another full-screen DirectX application when Aero is enabled?

推荐答案

看看绕行路线

使用绕行路线,您可以检测 Direct3DCreate9 IDirect3D9 :: CreateDevice IDirect3D9 :: Present ,您将在其中执行必要的操作设置,然后进行帧捕获。

Using Detours, you can instrument calls like Direct3DCreate9, IDirect3D9::CreateDevice and IDirect3D9::Present in which you perform the operations necessary to setup and then do a frame capture.

这篇关于拍摄DirectX全屏应用程序的屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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