public class AnimatedGifEncoder
extends java.lang.Object
| 构造器和说明 |
|---|
AnimatedGifEncoder() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
addFrame(java.awt.image.BufferedImage im)
Adds next GIF frame.
|
boolean |
finish()
Flushes any pending data and closes output file.
|
void |
setDelay(int ms)
Sets the delay time between each frame, or changes it for subsequent frames (applies to last
frame added).
|
void |
setDispose(int code)
Sets the GIF frame disposal code for the last added frame and any subsequent frames.
|
void |
setFrameRate(float fps)
Sets frame rate in frames per second.
|
void |
setQuality(int quality)
Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by
the GIF specification).
|
void |
setRepeat(int iter)
Sets the number of times the set of GIF frames should be played.
|
void |
setSize(int w,
int h)
Sets the GIF frame size.
|
void |
setTransparent(java.awt.Color c)
Sets the transparent color for the last added frame and any subsequent frames.
|
boolean |
start(java.io.OutputStream os)
Initiates GIF file creation on the given stream.
|
boolean |
start(java.lang.String file)
Initiates writing of a GIF file with the specified name.
|
public void setDelay(int ms)
ms - int delay time in millisecondspublic void setDispose(int code)
code - int disposal code.public void setRepeat(int iter)
iter - int number of iterations.public void setTransparent(java.awt.Color c)
c - Color to be treated as transparent on display.public boolean addFrame(java.awt.image.BufferedImage im)
finish()
flushes all frames. If setSize was not invoked, the size of the first image is
used for all subsequent frames.im - BufferedImage containing frame to write.public boolean finish()
public void setFrameRate(float fps)
setDelay(1000/fps).fps - float frame rate (frames per second)public void setQuality(int quality)
quality - int greater than 0.public void setSize(int w,
int h)
w - int frame width.h - int frame width.public boolean start(java.io.OutputStream os)
os - OutputStream on which GIF images are written.public boolean start(java.lang.String file)
file - String containing output file name.