From f84419a6c0c52728e4f7f124819452ec35e7f892 Mon Sep 17 00:00:00 2001 From: oupson <31827294+oupson@users.noreply.github.com> Date: Tue, 23 Oct 2018 16:55:49 +0200 Subject: [PATCH] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d51c78..851c2fd 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,18 @@ animator.load(imageUrl) animator.play() ``` -To create animated png : WORK IN PROGRESS +To create animated png : + +```kotlin + +val apng = Apng() + +val file1 = File("image path 1") +val file2 = File("image path 2") + +apng.addFrames(BitmapFactory.decodeByteArray(file1.readBytes(), 0, file1.readBytes().size)) +apng.addFrames(BitmapFactory.decodeByteArray(file2.readBytes(), 0, file2.readBytes().size)) + +val apngByteArray = apng.generateAPNGByteArray() +File("output file path").writeBytes(apngByteArray) +```