pimoroni-pico icon indicating copy to clipboard operation
pimoroni-pico copied to clipboard

Functions for displaying PNG files are missing from PicoGraphics readmes

Open helgibbons opened this issue 2 years ago • 2 comments

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 :)

helgibbons avatar Oct 23 '23 12:10 helgibbons

I can't seem to get import pngdec to work like import jpegdec does. What did you use for your import statement? Thanks

barchard avatar Dec 26 '23 02:12 barchard

@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()

helgibbons avatar Jan 03 '24 14:01 helgibbons

The README here has been updated now :).

thirdr avatar May 30 '24 14:05 thirdr