Created
January 9, 2015 00:19
-
-
Save Andygmb/d40e07d5b9f57cfd4808 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import pygame | |
import cStringIO | |
from PIL import Image, ImageGrab | |
w = 345 | |
h = 170 | |
x, x1 = 1575, 1920 | |
y, y1 = 910, 1080 | |
resize = (1000, 800) | |
pygame.init() | |
screengrab = ImageGrab.grab(bbox=(x, y, x1, y1)).resize(resize) | |
tmp = cStringIO.StringIO() | |
screengrab.save(tmp, "bmp") | |
img = tmp.getvalue() | |
background = pygame.image.load(img) | |
Traceback (most recent call last): | |
File "C:\Users\Andrew\Desktop\Age2MaxiMapper.py", line 19, in <module> | |
background = pygame.image.load(img) | |
TypeError: must be string without null bytes, not str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment