diff options
author | Diego Roversi <diegor@tiscali.it> | 2020-05-03 11:57:32 +0200 |
---|---|---|
committer | Diego Roversi <diegor@tiscali.it> | 2020-05-03 11:57:32 +0200 |
commit | 9c32edfdd54e0ad22fed09c33262f5963accfaf6 (patch) | |
tree | d06e27743c4f6e0a0add3196d045dd4361913fd3 /display/dpy_pygame.py | |
parent | 4a2a48ee144ab2389e3006e9789b50402919e53e (diff) |
display: more conversion from string to bytearray
Diffstat (limited to 'display/dpy_pygame.py')
-rw-r--r-- | display/dpy_pygame.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/display/dpy_pygame.py b/display/dpy_pygame.py index 498b5dc..a3c2a1f 100644 --- a/display/dpy_pygame.py +++ b/display/dpy_pygame.py @@ -72,7 +72,8 @@ class Display: def pixmap(self, w, h, data, colorkey=-1): print(f"pixmap type(data) = {type(data)}, data={data[:128]}", file=sys.stderr) - img = pygame.image.fromstring(data, (w, h), "RGB") + print(f"pixmap len(data) = {len(data)}, (h, w) = {(h, w)}", file=sys.stderr) + img = pygame.image.fromstring(data[:w*h*3], (w, h), "RGB") if colorkey >= 0: r = colorkey & 0xFF g = (colorkey >> 8) & 0xFF |