JVM Languages
Displaying GIF Images on J2ME Mobile Phones
By Tom Thompson, February 01, 2006
Source Code Accompanies This Article. Download It Now.
Surprisingly, many Java-based mobile phones couldn't display GIF image files--until now.
February, 2006: Displaying GIF Images on J2ME Mobile Phones
| Result |
Constructor/Method |
Description |
| Constructor |
|
|
| GifDecoder |
GifDecoder(void) |
Constructor that generates an instance of the GIF decoder object. |
| Methods |
| int |
getDelay(int frameNumber) |
Returns the delay time, in milliseconds, associated with the image specified by frameNumber. |
| Image |
getFrame(int frameNumber) |
Returns the image specified by frameNumber. |
| int |
getFrameCount(void) |
Returns the number of images (frames) in an animated GIF file. |
| Image |
getImage(void) |
Returns the first image in an animated GIF file. |
| int |
getLoopCount(void) |
Returns a value that represents the times the animation should loop. |
| int |
read(DataInputStream is) |
Reads the referenced DataInputStream object. Returns a status code of zero if no errors occurred during the read. |
| int |
read(InputStream is) |
Reads the referenced InputStream object. Returns a status code of zero if no errors occurred during the read. |
| int |
read(String name) |
Reads the named resource in the MIDlet's JAR file. Returns a status code of zero if no errors occurred during the read. |
Table 1: GifDecoder class and methods.