如何在android中通过两个位图制作gif图像 [英] how to make gif image by two bitmaps in android

查看:34
本文介绍了如何在android中通过两个位图制作gif图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想从 2 个位图图像制作动画 gif 图像,我将从相机中获取这些图像并希望邮寄该 gif 图像.

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.

推荐答案

有本地库 http://jiggawatt.org/badc0de/android/index.html#gifflen

我为 Android 编写了一个小型原生库来对位图进行颜色量化(从 2 到 256 种颜色),并将结果保存为动画 GIF 中的帧(您可以添加任意数量的帧).您可以根据自己的需要修改和削减库代码.使用的颜色量化器是 Anthony Dekker 的 NeuQuant,我做了一些修改.

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.

对于基于 Java 的库,请尝试 http://www.jappit.com/blog/2008/12/04/j2me-animated-gif-encoder/

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

使用非常简单,需要以下步骤:实例化您的 AnimatedGifEncoder 对象通过将 OutputStream 作为参数传递(例如:ByteArrayOutputStream)来启动它使用 addFrame() 方法添加 Image 对象通过调用finish()完成

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()

这篇关于如何在android中通过两个位图制作gif图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆