ponty / pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
BSD 2-Clause "Simplified" License
499 stars 89 forks source link

Make screenshot of a running application? #65

Closed derived-coder closed 3 years ago

derived-coder commented 5 years ago

I started an external GUI application via python subprocess. How can I make a screenshot of it?

ponty commented 4 years ago

You have to know the window position and size, then call grab:

im = ImageGrab.grab(bbox=(10, 10, 510, 510))  # X1,Y1,X2,Y2