Method | Description | |
---|---|---|
AddFrame ( Image im, int x, int y ) : bool |
Adds next GIF frame. The frame is not written immediately, but is actually deferred until the next frame is received so that timing data can be inserted. Invoking
|
|
Dispose ( ) : void | ||
Finish ( ) : bool |
Flushes any pending data and closes output file. If writing to an OutputStream, the stream is not closed.
|
|
SetDelay ( int ms ) : void |
Sets the delay time between each frame, or changes it for subsequent frames (applies to last frame added).
|
|
SetDispose ( int code ) : void |
Sets the GIF frame disposal code for the last added frame and any subsequent frames. Default is 0 if no transparent color has been set, otherwise 2.
|
|
SetFrameRate ( float fps ) : void |
Sets frame rate in frames per second. Equivalent to
|
|
SetQuality ( int quality ) : void |
Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification). Lower values (minimum = 1) produce better colors, but slow processing significantly. 10 is the default, and produces good color mapping at reasonable speeds. Values greater than 20 do not yield significant improvements in speed.
|
|
SetRepeat ( int iter ) : void |
Sets the number of times the set of GIF frames should be played. Default is 1; 0 means play indefinitely. Must be invoked before the first image is added.
|
|
SetSize ( int w, int h ) : void |
Sets the GIF frame size. The default size is the size of the first frame added if this method is not invoked.
|
|
SetTransparent ( Color c ) : void |
Sets the transparent color for the last added frame and any subsequent frames. Since all colors are subject to modification in the quantization process, the color in the final palette for each frame closest to the given color becomes the transparent color for that frame. May be set to null to indicate no transparent color.
|
|
Start ( |
Initiates GIF file creation on the given stream. The stream is not closed automatically.
|
|
Start ( String file ) : bool |
Initiates writing of a GIF file with the specified name.
|
|
StringToByteArray ( String hex ) : byte[] |
Converts a String to a byte Array.
|
Method | Description | |
---|---|---|
AnalyzePixels ( ) : void |
Analyzes image colors and creates color map.
|
|
FindClosest ( Color c ) : int |
Returns index of palette color closest to given color.
|
|
GetImagePixels ( ) : void |
Extracts image pixels into byte array "pixels".
|
|
WriteComment ( string comment ) : void |
Writes the comment for the animation.
|
|
WriteGraphicCtrlExt ( ) : void |
Writes Graphic Control Extension.
|
|
WriteImageDesc ( int width, int heigth, int x, int y ) : void |
Writes Image Descriptor.
|
|
WriteLsd ( ) : void |
Writes Logical Screen Descriptor
|
|
WriteNetscapeExt ( ) : void |
Writes Netscape application extension to define the repeat count.
|
|
WritePalette ( ) : void |
Writes color table.
|
|
WritePixels ( int width, int height ) : void |
Encodes and writes pixel data.
|
|
WriteShort ( int value ) : void |
Write 16-bit value to output stream, LSB first.
|
|
WriteString ( String s ) : void |
Writes string to output stream.
|
public AddFrame ( Image im, int x, int y ) : bool | ||
im | Image | BufferedImage containing frame to write. |
x | int | The horizontal position of the frame |
y | int | The vertical position of the frame |
return | bool |
public SetDelay ( int ms ) : void | ||
ms | int | Delay time in milliseconds |
return | void |
public SetDispose ( int code ) : void | ||
code | int | Disposal code. |
return | void |
public SetFrameRate ( float fps ) : void | ||
fps | float | Frame rate (frames per second) |
return | void |
public SetQuality ( int quality ) : void | ||
quality | int | Quality value greater than 0. |
return | void |
public SetRepeat ( int iter ) : void | ||
iter | int | Number of iterations. |
return | void |
public SetSize ( int w, int h ) : void | ||
w | int | The frame width. |
h | int | The frame weight. |
return | void |
public SetTransparent ( Color c ) : void | ||
c | Color | Color to be treated as transparent on display. |
return | void |
public Start ( |
||
os | OutputStream on which GIF images are written. | |
return | bool |
public Start ( String file ) : bool | ||
file | String | String containing output file name. |
return | bool |
public static StringToByteArray ( String hex ) : byte[] | ||
hex | String | The string to convert |
return | byte[] |