Displaying an animated PNG (apng) using Swing?
Asked Answered
B

1

14

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

Bloom answered 12/3, 2013 at 19:50 Comment(9)
There doesn't seem to be much support for APNG in Java at the moment. Most examples I found required you to physically read the file yourself, which is a lot of additional overhead...Degree
APNG is not standard PNGAfrikaner
'The way' would be to add an SPI for APNG to the run-time class-path of the app. Given the comment of @Afrikaner though, I doubt you will find an existing SPI.Zia
@Afrikaner I understand that. You don't know of any "API" which implements it anyway?Bloom
@Zar: No, I've been looking into it (perhaps to include support in my PNGJ library), but frankly I disliked its approach. But there might exist other libraries.Afrikaner
@Afrikaner Hmm, okay. I'll keep on looking. Thanks for your input.Bloom
@AndrewThompson Thought so as well, sadly. Thanks anyways, though.Bloom
Did you find a way to display apng in Swing?Oca
@André No, I went with a simple GIF instead.Bloom

© 2022 - 2024 — McMap. All rights reserved.