拍摄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.