Take screenshot of DirectX full-screen application

后端 未结 7 1349
傲寒
傲寒 2020-11-28 06:09

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

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 06:51

    Here is a C# example of hooking IDirect3DDevice9 objects via DLL injection and function hooking using EasyHook (like Microsoft Detours). This is similar to how FRAPS works.

    This allows you to capture the screen in windowed / fullscreen mode and uses the back buffer which is much faster than trying to retrieve data from the front buffer.

    A small C++ helper DLL is used to determine the methods of the IDirect3DDevice9 object to hook at runtime.

    Update: for DirectX 10/11 see Screen capture and overlays for D3D 9, 10 and 11

提交回复
热议问题