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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy