PIL ImageGrab to capture the selected window in Python

Viewed 4136

How can I use ImageGrab.grab()) in a specific manner to capture the selected window rather than the whole screen or boundary box?

For a better understanding, I am currently using this line below, which basically captures the given boundary box:

        screen =  np.array(ImageGrab.grab(bbox=(0,40,800,640)))

Thanks!

1 Answers
Related