-
Notifications
You must be signed in to change notification settings - Fork 12
Styling Modification Basics
Maschine2501 edited this page Aug 30, 2020
·
2 revisions
The Code uses PIL (Pillow) to generate the displayed Picture.
The generated Picture is displayed on the Oled with the LUMA Module.
image = Image.new('RGB', (oled.WIDTH, oled.HEIGHT))
self.draw.text((self.ArtistPosition), oled.activeArtist, font=font, fill='white')
self.draw.rectangle((Screen1barLineX , Screen1barLineThick1, Screen1barLineX+Screen1barwidth, Screen1barLineThick2), outline=Screen1barLineBorder, fill=Screen1barLineFill)
image.paste(self.image, (0, 0))
Every 0.034 seconds, the "UPDATE_INTERVAL = 0.034" forces the code to push the "Draw-On" Modal and generates a new Image, after that, the code "crops" the resulting Image and displays it on the OLED-Screen:
cimg = image.crop((0, 0, oled.WIDTH, oled.HEIGHT))
oled.display(cimg)