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 7
7
8
8
display = board .DISPLAY
9
9
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
-
40
10
# Setup the file as the bitmap data source
41
11
bitmap = displayio .OnDiskBitmap ("/purple.bmp" )
42
12
You can’t perform that action at this time.
0 commit comments