(image source: https://apng.onevcat.com/demo/)
APNG is a format that extends PNG with support for animations, similar to animated gifs.
This class, which is implemented in B4X, extracts the frames from the APNG file and creates the animation.
It doesn't support all possible formats. If you encounter a file that is not supported then post it.
It depends on B4XCollections v1.08+ which is an internal library. B4XCollections v1.08 is attached (should be copied to the internal libraries folder if your version is older).
Under the hood it uses RandomAccessFile + BytesBuilder + BitmapCreator + native CRC32 implementation to extract the frames, build temporary images that are loaded as regular bitmaps and then animate them.
Tip: You can use this tool to create APNG images: http://apngasm.sourceforge.net/
- V1.10 - Adds support for images with inter-frame optimizations: http://littlesvr.ca/apng/inter-frame.html