Skip to content

Commit 9f6be44

Browse files
authored
Merge pull request #24 from makermelissa/master
Update Pillow Demo for latest version
2 parents 404a6f5 + dda5d65 commit 9f6be44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/sharpmemorydisplay_pillow_demo.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
scs = digitalio.DigitalInOut(board.D6) # inverted chip select
2929

3030
# display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 96, 96)
31+
# display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 400, 240)
3132
display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 144, 168)
3233

3334
# Clear display.
@@ -56,7 +57,8 @@
5657

5758
# Draw Some Text
5859
text = "Hello World!"
59-
(font_width, font_height) = font.getsize(text)
60+
bbox = font.getbbox(text)
61+
(font_width, font_height) = bbox[2] - bbox[0], bbox[3] - bbox[1]
6062
draw.text(
6163
(display.width // 2 - font_width // 2, display.height // 2 - font_height // 2),
6264
text,

0 commit comments

Comments
 (0)