I would like to do a screenshot with lackey of ideally the screen of an app (but to begin with, a screenshot of the whole screen would be OK).
I have tried
from lackey import *
notepad = App('notepad.exe')
notepad.open()
focusWindow = notepad.focusedWindow()
s = Screen(0)
r = s.capture()
with open("toto.bmp", "wb") as f:
f.write(r)
The picture cannot be open because the function capture
returns a numpy.ndarray
.
I also tried to do the following but the result is the same:
r = Screen.capture(focusWindow)
Anyone knows how to do a screenshot?
Thanks