Skip to content

Commit 25e5fdf

Browse files
committed
use new OnDiskBitmap API
1 parent 5ae0659 commit 25e5fdf

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

README.rst

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,19 @@ Usage Example
9393
9494
g = displayio.Group()
9595
96-
# CircuitPython 6 & 7 compatible
97-
f = open("/display-ruler.bmp", "rb")
98-
pic = displayio.OnDiskBitmap(f)
99-
t = displayio.TileGrid(
100-
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
101-
)
102-
103-
# # CircuitPython 7 compatible only
104-
# pic = displayio.OnDiskBitmap("/display-ruler.bmp")
105-
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
106-
96+
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
97+
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
10798
g.append(t)
10899
109100
display.root_group = g
110101
111102
display.refresh()
103+
112104
print("refreshed")
113105
114106
time.sleep(120)
115107
108+
116109
Documentation
117110
=============
118111

examples/ssd1681_simpletest.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,14 @@
4040

4141
g = displayio.Group()
4242

43-
with open("/display-ruler.bmp", "rb") as f:
44-
pic = displayio.OnDiskBitmap(f)
45-
# CircuitPython 6 & 7 compatible
46-
t = displayio.TileGrid(
47-
pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
48-
)
49-
# CircuitPython 7 compatible only
50-
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
51-
g.append(t)
43+
pic = displayio.OnDiskBitmap("/display-ruler.bmp")
44+
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
45+
g.append(t)
5246

53-
display.root_group = g
47+
display.root_group = g
5448

55-
display.refresh()
49+
display.refresh()
5650

57-
print("refreshed")
51+
print("refreshed")
5852

59-
time.sleep(120)
53+
time.sleep(120)

0 commit comments

Comments
 (0)