File tree Expand file tree Collapse file tree 1 file changed +0
-30
lines changed
CircuitPython_displayio/displayio_ondiskbitmap Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Original file line number Diff line number Diff line change 77
88display = 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
4111bitmap = displayio .OnDiskBitmap ("/purple.bmp" )
4212
You can’t perform that action at this time.
0 commit comments