import ImageGrab
ImageGrab.grab().save("my_screenshot.jpg", "JPEG")
I have an application. This application is primarily QT which, in certain states, has embedded html elements. When this application is run on my local computer (Windows 7) and I execute the above code, the screenshots are taken perfectly. Everything is visible.
However, when I run my application on other computers and execute the above code, it does take screenshots, but those screenshot do not show my application. What makes it even more weird is that when the application is in certain states, screenshots are successful. But in other states, it is not (everything is visible but my application). Sometimes it has to do with web elements, but on the same hand sometimes other web elements are shown just fine. Unfortunately I wasn't able to pick up the pattern when it is successful and when it is not. All I know is that ImageGrab.grab() doesn't show all visible applications at a given time on some computers (same operating system). But if I do native PrtScn command, my application is shown just fine no matter what state it is at.
Any suggestions?