public class GIFEncoder
extends java.lang.Object
Write.Three caveats:
java.awt.AWTException: Grabber returned false: 192
GIFEncoder is based upon gifsave.c, which was written and released by:
Phone: +47 2 230539
sverrehu@ifi.uio.no
| Constructor and Description |
|---|
GIFEncoder(byte[][] r,
byte[][] g,
byte[][] b)
Construct a GIFEncoder.
|
GIFEncoder(java.awt.Image image)
Construct a GIFEncoder.
|
GIFEncoder(int[] values,
int width,
int height)
Construct a GIFEncoder.
|
| Modifier and Type | Method and Description |
|---|---|
void |
write(java.io.OutputStream output)
Writes the image out to a stream in the GIF file format.
|
public GIFEncoder(java.awt.Image image)
throws java.awt.AWTException
image - The image to encode. The image must be
completely loaded.java.awt.AWTException - Will be thrown if the pixel grab fails. This
can happen if Java runs out of memory. It may also indicate that the image
contains more than 256 colors.public GIFEncoder(int[] values,
int width,
int height)
throws java.awt.AWTException
image - The image to encode. The image must be
completely loaded.java.awt.AWTException - Will be thrown if the pixel grab fails. This
can happen if Java runs out of memory. It may also indicate that the image
contains more than 256 colors.public GIFEncoder(byte[][] r,
byte[][] g,
byte[][] b)
throws java.awt.AWTException
Each array stores intensity values for the image. In other words, r[x][y] refers to the red intensity of the pixel at column x, row y.
r - An array containing the red intensity values.g - An array containing the green intensity values.b - An array containing the blue intensity values.java.awt.AWTException - Will be thrown if the image contains more than
256 colors.public void write(java.io.OutputStream output)
throws java.io.IOException
output - The stream to output to. This should probably be a
buffered stream.java.io.IOException - Will be thrown if a write operation fails.