Open lxk696 opened 9 months ago
This is how it is supposed to work according to the documentation. The win32gui.GetWindowRect function works differently and you have to fix it in your own code.
Something like this: winRegion = win32gui.GetWindowRect(edit_content_handle) pyautogui.screenshot("target.jpg", region=(winRegion[0], winRegion[1], winRegion[2]-winRegion[0], winRegion[3]-winRegion[1]))
In method [_screenshot_xxx ]; Use param[region] error, causing larger screenshots
In the latest version of pyscreen。 win10 + python 3.11.5
The region obtained using the method[ win32gui.GetWindowRect ]
region = win32gui.GetWindowRect(edit_content_handle) pyautogui.screenshot("target.jpg", region=region)
fix the method [ def _screenshot_win32(imageFilename=None, region=None): ]
return the screenshot img
but desired screenshot like this;
After modifying the _screenshot_win32 code, the following image can be obtained correctly