pimoroni-pico
pimoroni-pico copied to clipboard
Functions for displaying PNG files are missing from PicoGraphics readmes
They can mostly be deduced from the JPG functions, but they would be less of a mystery if we added them to the relevant readmes :)
I can't seem to get import pngdec to work like import jpegdec does. What did you use for your import statement? Thanks
@barchard This works for me on a Tufty 2040. I think pngdec was quite a recent addition, so it might be worth downloading the most MicroPython image for your board if you're having trouble?
import picographics
import pngdec
display = picographics.PicoGraphics(display=picographics.DISPLAY_TUFTY_2040)
# Create a new PNG decoder for our PicoGraphics
p = pngdec.PNG(display)
# Open the PNG file
p.open_file("filename.png")
# Decode the PNG
p.decode(0, 0)
# Display the result
display.update()
The README here has been updated now :).