Construct a GIF Frame
The GifFrame java class
is used as a container to aggregate and encode the gif format specific information about a single gif image frame.
GifFrame constructors can be divided into 2 types according to the desired frame position (absolute or relative).
"absolute positioning" costructors contain Point parameter and
"relative positioning" constructors contain layout constraint parameter.
Note: If you use "relative positioning" then
the final position is calculated according to one of the predifined layout constraint
before the final encoding process starts.
Absolute and Relative Internal GIF Frame Positioning
Below examples demostrate relative positioning and how you can use it (see examples/FramePositioning):

(size: 300x300, every frame size: 100x100)

(size: 200x200, every frame size: 100x100)

image tour (size: 300x240, every frame is scaled down using ImageUtils to 150x130)
Disposal Methods & Delay Time
Disposal Method - indicates the way in which the graphic is to be treated after being displayed.
According to Gif89a format specification there are 4 disposal methods:
Not Specified,
Do Not Dispose,
Restore To Background Color and
Restore To Previous.
You can set disposal method through corresponding GifFrame
constructors or using the next method:
public void setDisposalMethod(int disposalMethod)
Delay Time - If not 0, this field specifies the number of
hundredths (1/100) of a second to wait before continuing with the
processing of the Data Stream. The clock starts ticking immediately
after the graphic is rendered.
You can set delay time through corresponding GifFrame
constructors or using the next method:
public void setDelay(int delay)
Adding GIF Frames to a GIF Image
To add GifFrame(s) to GifImage(s)
you can use the next method (please consult GifFrame API for more information):
public GifImage addGifFrame(GifFrame frame)
|