com.lowagie.text.pdf.codec
Class GifImage

java.lang.Object
  extended bycom.lowagie.text.pdf.codec.GifImage

public class GifImage
extends Object

Reads gif images of all types. All the images in a gif are read in the constructors and can be retrieved with other methods.

Author:
Paulo Soares (psoares@consiste.pt)

Constructor Summary
GifImage(byte[] data)
          Reads gif images from a byte array.
GifImage(InputStream is)
          Reads gif images from a stream.
GifImage(String file)
          Reads gif images from a file.
GifImage(URL url)
          Reads gif images from an URL.
 
Method Summary
 int getFrameCount()
          Gets the number of frames the gif has.
 int[] getFramePosition(int frame)
          Gets the [x,y] position of the frame in reference to the logical screen.
 Image getImage(int frame)
          Gets the image from a frame.
 int[] getLogicalScreen()
          Gets the logical screen.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GifImage

public GifImage(URL url)
         throws IOException
Reads gif images from an URL.

Parameters:
url - the URL
Throws:
IOException - on error

GifImage

public GifImage(String file)
         throws IOException
Reads gif images from a file.

Parameters:
file - the file
Throws:
IOException - on error

GifImage

public GifImage(byte[] data)
         throws IOException
Reads gif images from a byte array.

Parameters:
data - the byte array
Throws:
IOException - on error

GifImage

public GifImage(InputStream is)
         throws IOException
Reads gif images from a stream. The stream is not closed.

Parameters:
is - the stream
Throws:
IOException - on error
Method Detail

getFrameCount

public int getFrameCount()
Gets the number of frames the gif has.

Returns:
the number of frames the gif has

getImage

public Image getImage(int frame)
Gets the image from a frame. The first frame is 1.

Parameters:
frame - the frame to get the image from
Returns:
the image

getFramePosition

public int[] getFramePosition(int frame)
Gets the [x,y] position of the frame in reference to the logical screen.

Parameters:
frame - the frame
Returns:
the [x,y] position of the frame

getLogicalScreen

public int[] getLogicalScreen()
Gets the logical screen. The images may be smaller and placed in some position in this screen to playback some animation. No image will be be bigger that this.

Returns:
the logical screen dimensions as [x,y]


Copyright © 2011 EGIZ - E-Government Innovation Center. All Rights Reserved.