package com.util.helper;
import android.graphics.Bitmap;
import android.util.Log;
public class GifMaker {
private final String TAG=this.getClass().getName();
static
{
try {
System.loadLibrary("gifflen");
} catch (Exception e) {
e.printStackTrace();
//System.err.println("WARNING: Could not load library!");
Log.e("Giffle","WARNING: Could not load library!");
}
}
public GifMaker(){
framecount=0;
}
/**
* Init the gif file
* @param gifName name
* @param w width
* @param h height
* @param numColors colors
* @param quality
* @param frameDelay times
* @return
*/
public native int Init(String gifName, int w, int h, int numColors, int quality, int frameDelay);
public native void Close();
public native int AddFrame(int[] pixels);
public int add(String gifName,Bitmap b)
{
if(b==null){
Log.e(TAG,"add bitmap is
android制作gif之GifMaker
最新推荐文章于 2021-05-26 00:45:20 发布