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

Revised version of DXHookD3D9 #11

Closed remcoros closed 10 years ago

remcoros commented 10 years ago

The D3D9 version does not use SharpDX ToStream() method to get the image byte data, that means that on the receiving side we also cannot use Bitmap.FromStream. To fix this, I added Width/Height and Pitch to the screenshot class. On the client this is checked and when they are specified it uses LockBits to generate the bitmap. This allows both the DX9 and other versions to work, (e.g. use SharpDX ToStream and don't specify width/height or use raw byte[] data and specify height/width)

remcoros commented 10 years ago

Sorry about the white-spacing, to get a good compare you should probably use your local compare tool and ignore white-space differences.

justinstenning commented 10 years ago

Thanks I'll take a look tmrw.

On Monday, 3 February 2014, Remco Ros notifications@github.com wrote:

Sorry about the whitespacing, to get a good compare you should probably use your local compare tool and ignore whitespace differenes.

Reply to this email directly or view it on GitHubhttps://github.com/spazzarama/Direct3DHook/pull/11#issuecomment-33941197 .

remcoros commented 10 years ago

If you have any question and want to chat. I stream a lot on twitch.tv/GameForFree.

justinstenning commented 10 years ago

Hi remcoros the white-spacing made it difficult to pull, so I've incorporated most of your changes manually. Will be committing into a new branch "GPUResize" shortly along with some resize code (DX9 only, the DX10 & 11 work is still in progress).