ev3dev / ev3dev-lang-python

Pure python bindings for ev3dev
MIT License
425 stars 144 forks source link

Color LCD #694

Closed asaldele1 closed 4 years ago

asaldele1 commented 4 years ago

Question

Can I draw color shapes on color LCD with PIL.ImageDraw.Draw like that?

#!/usr/bin/env python3
from ev3dev2.display import Display
d = Display()
d.draw.rectangle((10,10,60,20), fill='red')

Desktop:

Robot:

========== ev3dev-sysinfo ==========
Image file:         ev3dev-stretch-ev3-generic-2019-10-23
Kernel version:     4.14.117-ev3dev-2.3.4-ev3
Brickman:           0.10.2
BogoMIPS:           148.88
Bluetooth:          
Board:              board0
BOARD_INFO_HW_REV=8
BOARD_INFO_MODEL=LEGO MINDSTORMS EV3
BOARD_INFO_ROM_REV=6
BOARD_INFO_SERIAL_NUM=0016536361DD
BOARD_INFO_TYPE=main
WasabiFan commented 4 years ago

Hmmm... I would say the answer is "yes", but the hack we're using to handle the fact that the normal greyscale display reports as 32bpp might actually mess this up. Have you tried it? Does it work?

If not, can you try manually commenting out the lines linked to above in your installed version of the library? (Let me know if you don't know how to do that and I can write some more details.) You should be able to figure out where it's installed by doing the following in a Python shell:

import ev3dev2.display

print(ev3dev2.display.__file__)
dwalton76 commented 4 years ago

@asaldele1 please re-open this ticket if you try draw the red rectangle and it does not work