Class GifImage

java.lang.Object
com.aowagie.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 Details

    • GifImage

      public GifImage(URL url) throws IOException
      Reads gif images from an URL.
      Parameters:
      url - the URL
      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
  • Method Details

    • 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
    • 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]