Create basis for robotstreamer

This commit is contained in:
Kenwood 2022-04-07 08:25:13 -04:00
parent b32ec1880d
commit ff6d5805bf
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
from Xlib import display, X
from PIL import Image
W,H = 200,200
dsp = display.Display(':0')
try:
root = dsp.screen().root
raw = root.get_image(0, 0, W,H, X.ZPixmap, 0xffffffff)
image = Image.frombytes("RGB", (W, H), raw.data, "raw", "BGRX")
image.save('image.png')
finally:
dsp.close()