Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions examples/imageload_magtag_simpletest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
Basic imageload example script
adapted for use on MagTag.
"""
import time
import board
import displayio
import adafruit_imageload

# use built in display (PyPortal, PyGamer, PyBadge, CLUE, etc.)
# see guide for setting up external displays (TFT / OLED breakouts, RGB matrices, etc.)
# https://learn.adafruit.com/circuitpython-display-support-using-displayio/display-and-display-bus
display = board.DISPLAY

# wait until the display is ready
time.sleep(display.time_to_refresh)

image, palette = adafruit_imageload.load("images/magtag_2x2_test.bmp")

tile_grid = displayio.TileGrid(image, pixel_shader=palette)

# scale 8 for full screen
group = displayio.Group(scale=8)
group.append(tile_grid)

# show the group and refresh
display.show(group)
display.refresh()

while True:
pass
Binary file added examples/images/magtag_2x2_test.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/images/magtag_2x2_test.bmp.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2020 Foamyguy
#
# SPDX-License-Identifier: Unlicense