superwaba.ext.xplat.fx.gif
Class GifImage

java.lang.Object
  |
  +--waba.fx.Image
        |
        +--superwaba.ext.xplat.fx.gif.GifImage

public class GifImage
extends Image

A GifImage is simply a waba.fx.Image, except for its specific constructor. Multi-frame GIFs are supported via the getAllFrames method.


Fields inherited from class waba.fx.Image
height, palRGBs, pixels, savingPal, transparentColor, transparentPixel, width
 
Constructor Summary
GifImage()
          Default Constructor You can call this constructor and then call load(Stream), although the use of the other constructors is better.
GifImage(Stream gifStream)
          Constructor Creates the first image found in the given waba.io.Stream
GifImage(Stream gifStream, int imageNo)
          Constructor Creates the given image number found in the given waba.io.Stream
GifImage(java.lang.String fileName)
          Constructor Creates the first image found in the given file which belongs to the application pdb or an attached library.
GifImage(java.lang.String fileName, int imageNo)
          Constructor Creates the given image number found in the given file which belongs to the application pdb or an attached library.
 
Method Summary
 void copyFrom(Image img)
          Internal use only
static Image[] getAllFrames(Stream gifStream)
          Return an array of Images from reading a waba.io.stream containing a multi-frame image.
static Image[] getAllFrames(java.lang.String fileName)
          Return an array of Images from reading the multi-frame given file, which belongs to the application pdb or an attached library.
 void load(Stream gifStream)
          Implements the method to let us load the first image found in the given waba.io.Stream.  Must be called only once per image.
 void load(Stream gifStream, int imageNo)
          Load the the given image number found in the given waba.io.Stream.
 
Methods inherited from class waba.fx.Image
applyPalette, changeColors, createBmp, free, getGraphics, getHeight, getPalette, getPixelRow, getRotatedScaledInstance, getScaledInstance, getTouchedUpInstance, getTransparentColor, getWidth, saveTo, scaledBy, setPalette, setTransparentColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GifImage

public GifImage()
Default Constructor You can call this constructor and then call load(Stream), although the use of the other constructors is better.

GifImage

public GifImage(java.lang.String fileName)
         throws ImageError
Constructor Creates the first image found in the given file which belongs to the application pdb or an attached library.
Parameters:
fileName - name of the image file

GifImage

public GifImage(java.lang.String fileName,
                int imageNo)
         throws ImageError
Constructor Creates the given image number found in the given file which belongs to the application pdb or an attached library.
Parameters:
fileName - name of the multi-frame image file
imageNo - frame number of the image (starts at 0.)
Throws:
ImageError - Starting in SuperWaba version 5.8, when there's a problem with the image load and if Settings.useExceptions is true, an ImageError is thrown.

GifImage

public GifImage(Stream gifStream)
         throws ImageError
Constructor Creates the first image found in the given waba.io.Stream
Parameters:
gifStream - waba.io.Stream that contains the GIF data

GifImage

public GifImage(Stream gifStream,
                int imageNo)
         throws ImageError
Constructor Creates the given image number found in the given waba.io.Stream
Parameters:
gifStream - waba.io.Stream that contains the GIF data
imageNo - frame number of the image to be loaded (starts at 0.)
Method Detail

load

public void load(Stream gifStream)
          throws ImageError
Implements the method to let us load the first image found in the given waba.io.Stream.  Must be called only once per image.
Overrides:
load in class Image
Parameters:
gifStream - waba.io.Stream that contains the GIF data

load

public void load(Stream gifStream,
                 int imageNo)
          throws ImageError
Load the the given image number found in the given waba.io.Stream.
Parameters:
gifStream - waba.io.Stream that contains the GIF data
imageNo - frame number of the image to be loaded (starts at 0.)
Throws:
ImageError - Starting in SuperWaba version 5.8, when there's a problem with the image load and if Settings.useExceptions is true, an ImageError is thrown.

getAllFrames

public static Image[] getAllFrames(java.lang.String fileName)
                            throws ImageError
Return an array of Images from reading the multi-frame given file, which belongs to the application pdb or an attached library.
Parameters:
fileName - name of the multi-frame image file
Throws:
ImageError - Starting in SuperWaba version 5.8, when there's a problem with the image load and if Settings.useExceptions is true, an ImageError is thrown.

getAllFrames

public static Image[] getAllFrames(Stream gifStream)
                            throws ImageError
Return an array of Images from reading a waba.io.stream containing a multi-frame image.
Parameters:
gifStream - waba.io.Stream that contains the GIF data
Throws:
ImageError - Starting in SuperWaba version 5.8, when there's a problem with the image load and if Settings.useExceptions is true, an ImageError is thrown.

copyFrom

public void copyFrom(Image img)
Internal use only