Skip to content

BMP not displaying properly using set_background() #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
caternuson opened this issue Nov 18, 2021 · 3 comments
Closed

BMP not displaying properly using set_background() #56

caternuson opened this issue Nov 18, 2021 · 3 comments

Comments

@caternuson
Copy link

Guessing this is just something related to changes in CP.

Was using this BMP for testing:
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/MagTag_Weather/bmps/weather_bg.bmp

And then this:

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit MagTag with ESP32S2
>>> from adafruit_magtag.magtag import MagTag
>>> magtag = MagTag()
>>> magtag.graphics.set_background("/bmps/weather_bg.bmp")
>>> magtag.display.refresh()
>>>

results in all dark display.

It seems to be MagTag library related. This example does work:

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit MagTag with ESP32S2
>>> import board
>>> import displayio
>>> display = board.DISPLAY
>>> bitmap = displayio.OnDiskBitmap("/bmps/weather_bg.bmp")
>>> tile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)
>>> group = displayio.Group()
>>> group.append(tile_grid)
>>> display.show(group)
>>> display.refresh()
>>> 
@makermelissa
Copy link
Collaborator

Ok, found the issue and moving to PortalBase...

@makermelissa makermelissa transferred this issue from adafruit/Adafruit_CircuitPython_MagTag Nov 18, 2021
@makermelissa
Copy link
Collaborator

Problem is this line: https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/blob/main/adafruit_portalbase/graphics.py#L84

New OnDiskBitmap wants a filename and not the data.

@dhalbert
Copy link
Contributor

dhalbert commented Dec 1, 2021

Fixed by #53.

@dhalbert dhalbert closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants