Reputation: 33
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
Reputation: 48948
You can use the SaveDDSTextureToFile
from 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