justinstenning / Direct3DHook

DirectX Capture and Overlays by using Direct3D API hooks
http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks
MIT License
582 stars 176 forks source link

Fix PixelData capture with Direct3D11 #51

Closed MathewSachin closed 7 years ago

MathewSachin commented 7 years ago

When taking screenshots on Direct3D11 of ImageFormat.PixelData only one image succeeds and rest fail.

It happens due to the subresource not being released.

I moved the code to release subresource into the finally blocked and it was fixed.