GeoSoft API

no.geosoft.cc.io
Class GifEncoder

Object
  |
  +--GifEncoder

public class GifEncoder
extends Object

Class for converting images to GIF files.

Contribution:

Author:
GeoSoft

Constructor Summary
GifEncoder(byte[][] r, byte[][] g, byte[][] b)
          Create a GIF encoder. r[i][j] refers to the pixel at column i, row j.
GifEncoder(Image image)
          Constructing a GIF encoder.
 
Method Summary
static void main(String[] args)
           
 void write(OutputStream stream)
          Writes the image out to a stream in GIF format.
static void writeFile(Component component, File file)
          Write AWT/Swing component to GIF file.
static void writeFile(Image image, File file)
          Write image to GIF file.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GifEncoder

public GifEncoder(Image image)
           throws AWTException
Constructing a GIF encoder.

Parameters:
image - The image to encode. The image must be completely loaded.
Throws:
AWTException - If memory is exhausted or image contains more than 256 colors.

GifEncoder

public GifEncoder(byte[][] r,
                  byte[][] g,
                  byte[][] b)
           throws AWTException
Create a GIF encoder. r[i][j] refers to the pixel at column i, row j.

Parameters:
r - Red intensity values.
g - Green intensity values.
b - Blue intensity values.
Throws:
AWTException - If memory is exhausted or image contains more than 256 colors.
Method Detail

writeFile

public static void writeFile(Image image,
                             File file)
                      throws AWTException,
                             IOException
Write image to GIF file.

Parameters:
image - Image to write.
file - File to erite to.
AWTException
IOException

writeFile

public static void writeFile(Component component,
                             File file)
                      throws AWTException,
                             IOException
Write AWT/Swing component to GIF file.

Parameters:
file - File to erite to.
AWTException
IOException

write

public void write(OutputStream stream)
           throws IOException
Writes the image out to a stream in GIF format. This will be a single GIF87a image, non-interlaced, with no background color.

Parameters:
stream - The stream to which to output.
Throws:
IOException - Thrown if a write operation fails.

main

public static void main(String[] args)

GeoSoft API

Copyright © 2004 - Geotechnical Software Services     geosoft.no