forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Milestone
Description
Current examples that download images from the web require you to write them to storage and then display them. This requires the filesystem to be read-write , a potentially destructive requirement.
Circuitpython io supports BytesIO, but there is no way to display an image that's loaded into a BytesIO object.
bg_bitmap_file = BytesIO(requests.get(url, stream=True).content)
bg_bitmap = displayio.OnDiskBitmap(bg_bitmap_file)
This code doesn't work as is throws an object type error.
I propose a new method displayio.BytesIOBitmap(bg_bitmap_file) that would allow display from a BytesIO object.