Skip to content

Commit 13e42db

Browse files
Update the pixel_shader usage of OnDiskBitmap
1 parent a0bf826 commit 13e42db

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/gizmo_eink_simpletest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
with open("/display-ruler.bmp", "rb") as file:
1717
picture = displayio.OnDiskBitmap(file)
1818
# Create a Tilegrid with the bitmap and put in the displayio group
19-
sprite = displayio.TileGrid(picture, pixel_shader=displayio.ColorConverter())
19+
sprite = displayio.TileGrid(
20+
picture,
21+
pixel_shader=getattr(picture, "pixel_shader", displayio.ColorConverter()),
22+
# TODO: Once CP6 is no longer supported, replace the above line with below
23+
# pixel_shader=picture.pixel_shader,
24+
)
2025
display_group.append(sprite)
2126

2227
# Place the display group on the screen

examples/gizmo_tft_thermometer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ def c_to_f(c_val):
4444
bitmap = displayio.OnDiskBitmap(bitmap_file)
4545

4646
# Create a TileGrid to hold the bitmap
47-
tile_grid = displayio.TileGrid(bitmap, pixel_shader=displayio.ColorConverter())
47+
tile_grid = displayio.TileGrid(
48+
bitmap,
49+
pixel_shader=getattr(bitmap, "pixel_shader", displayio.ColorConverter()),
50+
# TODO: Once CP6 is no longer supported, replace the above line with below
51+
# pixel_shader=bitmap.pixel_shader,
52+
)
4853

4954
# Create a Group to hold the TileGrid
5055
group = displayio.Group()

0 commit comments

Comments
 (0)