Skip to content

Commit 04de117

Browse files
committed
update ondiskbitmap usage for circuitpython 7+, remove fallback for 6
1 parent e685547 commit 04de117

File tree

1 file changed

+0
-30
lines changed
  • CircuitPython_displayio/displayio_ondiskbitmap

1 file changed

+0
-30
lines changed

CircuitPython_displayio/displayio_ondiskbitmap/code.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,6 @@
77

88
display = board.DISPLAY
99

10-
# Current method valid for CircuitPython 6 & 7
11-
12-
# Open the file
13-
with open("/purple.bmp", "rb") as bitmap_file:
14-
15-
# Setup the file as the bitmap data source
16-
bitmap = displayio.OnDiskBitmap(bitmap_file)
17-
18-
# Create a TileGrid to hold the bitmap
19-
tile_grid = displayio.TileGrid(
20-
bitmap,
21-
pixel_shader=getattr(bitmap, 'pixel_shader', displayio.ColorConverter())
22-
)
23-
24-
# Create a Group to hold the TileGrid
25-
group = displayio.Group()
26-
27-
# Add the TileGrid to the Group
28-
group.append(tile_grid)
29-
30-
# Add the Group to the Display
31-
display.show(group)
32-
33-
# Loop forever so you can enjoy your image
34-
while True:
35-
pass
36-
37-
38-
# Future method for CircuitPython 7 onwards
39-
4010
# Setup the file as the bitmap data source
4111
bitmap = displayio.OnDiskBitmap("/purple.bmp")
4212

0 commit comments

Comments
 (0)