[How to] capture screen image with EventGhost
Posted: Sun Jan 05, 2014 3:35 pm
Hello everyone,
I was searching for a way to make a screenshot (or windowshot) with EventGhost, in the end I came up with this little script I'd like to share with you:
It has to be triggered after the "Find Window" action.
I think it would be useful to have this functionality as action in the "Window" plugin - but I don't want to mess around with EGs core plugins, so I leave this task to more experienced developers
I was searching for a way to make a screenshot (or windowshot) with EventGhost, in the end I came up with this little script I'd like to share with you:
Code: Select all
import ImageGrab
import win32gui
hwnd = eg.lastFoundWindows[0]
bbox = win32gui.GetWindowRect(hwnd)
img = ImageGrab.grab(bbox)
img.save("c:/screen_capture.jpg", "JPEG")I think it would be useful to have this functionality as action in the "Window" plugin - but I don't want to mess around with EGs core plugins, so I leave this task to more experienced developers