Created
December 17, 2017 00:40
-
-
Save DanBrink91/087203b90d9e6552631857afd1be3599 to your computer and use it in GitHub Desktop.
record image of main monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import ImageGrab | |
import time | |
# Windows resolution size query | |
import ctypes | |
user32 = ctypes.windll.user32 | |
screensize = user32.GetSystemMetrics(0), user32.GetSystemMetrics(1) | |
i = 0 | |
while True: | |
i += 1 | |
img = ImageGrab.grab(bbox=(0, 0, screensize[0], screensize[1])) | |
img.save("whatever%d.jpg" % i, "JPEG") | |
time.sleep(1) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment