how to make gif image by two bitmaps in android

2019-04-08 15:27发布

I just want to make animated gif image from 2 bitmap images which i will get from camera and want to mail that gif image.

1条回答
ら.Afraid
2楼-- · 2019-04-08 16:03

There is native library for that http://jiggawatt.org/badc0de/android/index.html#gifflen

I've written a small native lib for Android to do color quantization (from 2-256 colors) of a Bitmap and save the result as a frame in an animated GIF (you can add as many frames as you like). You may hack and slash the library code as you wish to fit your needs. The color quantizer used is Anthony Dekker's NeuQuant, with some modifications made by me.

For a java based library try http://www.jappit.com/blog/2008/12/04/j2me-animated-gif-encoder/

Usage is quite straightforward, and it requires these steps: Instantiate your AnimatedGifEncoder object Start it, by passing an OutputStream as argument (e.g.: a ByteArrayOutputStream) Add your Image objects by using addFrame() method Finalize it by calling finish()

查看更多
登录 后发表回答