Raf Vandelaer
Raf Vandelaer

Reputation: 33

Capture fast ingame screen in DirectX in C++ or C#

For a project i'm trying to capture the screen of a game using c++ or c#. I know there are a lot of solutions on the web but none of them are working 100%

I'm wondering if someone can explain how I can capture it or give me a working example.. I'm curious if it's possible in c# with sharpDX or something else...

Kind regards!

Upvotes: 0

Views: 1087

Answers (1)

Rakete1111
Rakete1111

Reputation: 48948

You can use the SaveDDSTextureToFilefrom the DirectXTK library. It saves the current RenderTargetView Resource to a DDS file. Include ScreenGrab.h.

Usage:

ID3D11Resource* test = NULL;
mRenderTargetView->GetResource(&test);
SaveDDSTextureToFile(mContext, test, L"test.dds");
test->Release();

Upvotes: 1

Related Questions