Loads a png image file and display it as a Dispmanx layer.
Installing raspidmx
raspidmx is a library created by AndrewFromMelbourne that leaverages some of the capabilities of the Dispmanx API. Its a great starting point for anyone wishing to learn the Dispmanx API which is very poorly documented.
See the library homepage at https://github.com/AndrewFromMelbourne/raspidmx
Copy the entire folder onto the pi, say into /home/pi/raspidmx/
Look for the README.md note re building, currently:
You will need to install libpng before you build the program. On Raspbian
sudo apt-get install libpng12-dev
cd /home/pi/raspidmx
Then
sudo make
Using
Usage: pngview [-b
-b – set background colour 16 bit RGBA
e.g. 0x000F is opaque black
-d – Raspberry Pi display number
-l – DispmanX layer number
-x – offset (pixels from the left)
-y – offset (pixels from the top)
//If pngview is in the same directory as us:
./pngview -b 0 -l 3 /home/pi/camerarecord/image1.png & #Transparent background (-b), Layer 3 (-l)
//If pngview is elsewhere:
/home/pi/raspidmx/pngview/pngview -b 0 -l 3 /home/pi/camerarecord/image1.png & #Transparent background (-b), Layer 3 (-l)
//To clear images:
sudo killall pngview
Issues
There are limitations on how many images can be displayed. 2 at once seems OK, above this may cause problems. See thread here.
1 year ago
This is so disapointing to see nobody bothers to update it and keep it working for Rpi4. I know it’s for free, but… how hard can it be? Or at least make a comercial version and keep it updated.
2 years ago
there is no libpng12-dev to install. same problem for me, the latest libpng-dev is missing stuff this wants.
my Pi 3 stuff works, but now the Pi 4 I can’t get pngview to compile which I depend on!
3 years ago
Cannot compile under the latest libpng-dev. There is absolutely NO backward compatibility! Do these developers intentionally do this?
3 years ago
This is broken with the latest version of libpng…
3 years ago
“undefined reference to `png_write_row'””
What’s so hard about maintaining backward compatibility with this? I’m beginning to wonder if this is a conspiracy!!!