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
580 stars 178 forks source link

Region settings not correct. #77

Closed hirschi81 closed 1 year ago

hirschi81 commented 3 years ago

I wanted to capture some region from the upper right, but the settings that I've made with the TestScreenshot GUI, did not result in the correct region. I was able to track it down to the file "DXHookD3D11.cs", line 378: captureRegion = new Rectangle(this.Request.RegionToCapture.Left, this.Request.RegionToCapture.Top, this.Request.RegionToCapture.Right, this.Request.RegionToCapture.Bottom);

In order to match with the rectangle constructor I changed it into: captureRegion = new Rectangle(this.Request.RegionToCapture.Left, this.Request.RegionToCapture.Top, this.Request.RegionToCapture.Width, this.Request.RegionToCapture.Height);

Worked for me, and maybe it will help others, too. ;)

justinstenning commented 3 years ago

Thanks