I'm trying to display an animated png (known as apng
), by adding the image to a JLabel
as usual. This works fine with normal gif
-animations, however, I'd prefer to be able to support apng
aswell.
I've been searching the net for existing frameworks or solutions for this, finding nothing. Has anyone else found a way to display animated pngs in Swing?
To understand why I want to implement apng
, view the following example which demonstrates GIF's limitations: http://jsfiddle.net/RUX8w/ (your browser must support apng!)
Animated Portable Network Graphics (APNG) is a file format which extends the Portable Network Graphics (PNG) specification to permit animated images that work similarly to animated GIF files, while supporting 24-bit images and 8-bit transparency not available for GIFs.
A quick Google for "apng Java" turned up http://code.google.com/p/javapng and in particular, http://code.google.com/p/javapng/source/browse/trunk/javapng2/src/apng/com/sixlegs/png/AnimatedPngImage.java?r=300
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With