| 限定符和类型 | 方法和说明 | 
|---|---|
| static GifDrawable | createDrawable(byte[] bytes)使用二进制数组创建一个 GifDrawable | 
| static GifDrawable | createDrawable(java.lang.String filePath)使用文件绝对路径创建一个 GifDrawable | 
| void | destroy()销毁。 | 
| void | draw(android.graphics.Canvas canvas) | 
| android.graphics.Bitmap | getBitmap()获取用于渲染 Gif 的 Bitmap 内存 | 
| int | getCurrentFrame()获得 Gif 当前帧位置 | 
| android.graphics.Bitmap | getFrame(int frame)提取 Gif 指定帧图像。 | 
| int | getFrameCount()获取 Gif 总帧数 | 
| int | getFrameDuration()获取 Gif 当前帧间隔,单位毫秒(ms) | 
| int | getHeight()获取 Gif 的高 | 
| int | getIntrinsicHeight() | 
| int | getIntrinsicWidth() | 
| int | getOpacity() | 
| long | getPtr()获取 Gif 底层指针地址 | 
| int | getWidth()获取 Gif 的宽 | 
| void | gotoFrame(int frame)跳转到 Gif 指定帧。 | 
| boolean | isDestroy()是否被销毁 | 
| boolean | isPlaying()是否在播放 | 
| boolean | isStrict()是否启用了严格模式 | 
| void | play()播放 | 
| void | setAlpha(int alpha) | 
| void | setColorFilter(android.graphics.ColorFilter cf) | 
| void | setFrameDuration(int duration)设置 Gif 帧间隔 | 
| void | setOnFrameListener(GifDecoder.OnFrameListener onFrameListener)设置帧绘制监听器。 | 
| void | setStrict(boolean strict)设置是否启用严格模式。 | 
| void | stop()暂停播放 | 
| int | updateFrame() | 
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, onLayoutDirectionChanged, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setTintMode, setVisible, unscheduleSelfpublic static GifDrawable createDrawable(java.lang.String filePath)
filePath - 文件绝对路径public static GifDrawable createDrawable(byte[] bytes)
bytes - 二进制数组public void draw(android.graphics.Canvas canvas)
draw 在类中 android.graphics.drawable.Drawablepublic void setAlpha(int alpha)
setAlpha 在类中 android.graphics.drawable.Drawablepublic void setColorFilter(android.graphics.ColorFilter cf)
setColorFilter 在类中 android.graphics.drawable.Drawablepublic int getOpacity()
getOpacity 在类中 android.graphics.drawable.Drawablepublic int getIntrinsicWidth()
getIntrinsicWidth 在类中 android.graphics.drawable.Drawablepublic int getIntrinsicHeight()
getIntrinsicHeight 在类中 android.graphics.drawable.Drawablepublic int getFrameCount()
getFrameCount 在接口中 Gifpublic int getFrameDuration()
getFrameDuration 在接口中 Gifpublic void setFrameDuration(int duration)
setFrameDuration 在接口中 Gifduration - 帧间隔,单位毫秒(ms)public int getCurrentFrame()
getCurrentFrame 在接口中 Gifpublic void gotoFrame(int frame)
public android.graphics.Bitmap getFrame(int frame)
public void setStrict(boolean strict)
Gif.gotoFrame(int) 和 Gif.getFrame(int) 产生错误的结果。
 启用严格模式会带来一些性能损耗!public int updateFrame()
updateFrame 在接口中 Gifpublic android.graphics.Bitmap getBitmap()
public void setOnFrameListener(GifDecoder.OnFrameListener onFrameListener)
setOnFrameListener 在接口中 GifonFrameListener -