Update README.md

This commit is contained in:
oupson 2018-10-23 16:55:49 +02:00 committed by GitHub
parent e0a170c1db
commit f84419a6c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -18,4 +18,18 @@ animator.load(imageUrl)
animator.play() 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)
```