How can I play APNG files in android
Asked Answered
R

1

8

I want to play APNG files and create animated stickers in my app like LINE messenger! I can create apng using some tools like APNG Assembler. but I dont know how to play animated png in my app.

help me please!

Rhynd answered 18/7, 2016 at 7:40 Comment(1)
Hello! Have you found any solution? If so, what method / library do you use? I use github.com/sahasbhop/apng-view but it's not going very well if you load a lot together. @RhyndWelter
M
3

If you want to display or create apng files you could use this : https://github.com/oupson/Kapng-Android

Example of loading apng file into imageView :

ApngDecoder.decodeApngAsyncInto(context, URL("https://apng.onevcat.com/assets/elephant.png"), imageView)
Madelle answered 24/10, 2018 at 11:39 Comment(2)
how can you check if one file is APNG ? before loading it?Concertino
APNG are PNG with extra chunks. You may not want to check before loading it, as it require to go through the file and to check the existence of an apng chunk. Instead, you can load your PNG files with the library, as it support PNG and APNG. If you really want to check, there is a function to do that : isApng, but it is deprecated.Madelle

© 2022 - 2024 — McMap. All rights reserved.