public class

GifFrame

extends Object
implements AnimatedImageFrame
java.lang.Object
   ↳ com.facebook.animated.gif.GifFrame

Class Overview

A single frame of a GifImage.

Summary

Public Methods
void dispose()
Disposes the instance.
int getDisposalMode()
int getDurationMs()
Gets the duration of the frame.
int getHeight()
Gets the height of the frame.
int getTransparentPixelColor()
int getWidth()
Gets the width of the frame.
int getXOffset()
Gets the x-offset of the frame relative to the image canvas.
int getYOffset()
Gets the y-offset of the frame relative to the image canvas.
boolean hasTransparency()
void renderFrame(int width, int height, Bitmap bitmap)
Renders the frame to the specified bitmap.
Protected Methods
void finalize()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.animated.base.AnimatedImageFrame

Public Methods

public void dispose ()

Disposes the instance. This will free native resources held by this instance. Once called, other methods on this instance may throw. Note, the underlying native resources may not actually be freed until all associated instances AnimatedImage are disposed or finalized as well.

public int getDisposalMode ()

public int getDurationMs ()

Gets the duration of the frame.

Returns
  • the duration of the frame in milliseconds

public int getHeight ()

Gets the height of the frame.

Returns
  • the height of the frame

public int getTransparentPixelColor ()

public int getWidth ()

Gets the width of the frame.

Returns
  • the width of the frame

public int getXOffset ()

Gets the x-offset of the frame relative to the image canvas.

Returns
  • the x-offset of the frame

public int getYOffset ()

Gets the y-offset of the frame relative to the image canvas.

Returns
  • the y-offset of the frame

public boolean hasTransparency ()

public void renderFrame (int width, int height, Bitmap bitmap)

Renders the frame to the specified bitmap. The bitmap must have a width and height that is at least as big as the specified width and height and it must be in RGBA_8888 color format.

Parameters
width the width to render to (the image is scaled to this width)
height the height to render to (the image is scaled to this height)
bitmap the bitmap to render into

Protected Methods

protected void finalize ()