Skip to content

OnDiskBitmap usage should be updated to filename argument #34

Closed
@FoamyGuy

Description

@FoamyGuy

Many of the examples in this repo use the old way of initializing OnDiskBitmap with opened filestreams like

with open("/display-ruler.bmp", "rb") as f:
pic = displayio.OnDiskBitmap(f)

The ODB docs indicate that this will get removed eventually https://docs.circuitpython.org/en/latest/shared-bindings/displayio/index.html#displayio.OnDiskBitmap

Older versions of CircuitPython required a file opened in binary mode. CircuitPython 7.0 modified OnDiskBitmap so that it takes a filename instead, and opens the file internally. A future version of CircuitPython will remove the ability to pass in an opened file.

It looks like it hasn't been removed yet, but perhaps is worth considering doing for 10.x if we do still want to remove the backwards compatibility.

Either way though the code in the examples here (and any other libraries / learn projects) should get updated to use the new way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions