How to convert PNG image to GIF in Android programatically -
i working app in want convert images png format gif format please help me or suggestion
use gif encoder
class accomplish that. example, utilize https://github.com/nbadal/android-gif-encoder/blob/master/gifencoder.java
bytearrayoutputstream bos = new bytearrayoutputstream(); animatedgifencoder encoder = new animatedgifencoder(); encoder.start(bos); encoder.addframe(image); encoder.finish(); byte[] array = bos.tobytearray(); // save file file output = new file("output.gif"); fileoutputstream fos = new fileoutputstream(output.getpath()); fos.write(array); fos.close();
android android-imageview
No comments:
Post a Comment