|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.hccp.util.ImageWriter
A utility for writing image formats to output streams in GIF and JPEG encodings. This class currently has an external dependency on the ACME Labs GIFEncoder.
| Field Summary | |
static int |
GIF
|
static int |
JPEG
|
| Constructor Summary | |
ImageWriter()
|
|
| Method Summary | |
static void |
writeAsGif(java.awt.Image img,
java.io.OutputStream os)
encodes a java.awt.Image on the submitted java.io.OutputStream
as a GIF. |
static void |
writeAsJpeg(java.awt.Image img,
java.io.OutputStream os)
encodes a java.awt.image.BufferedImage on the submitted java.io.OutputStream
as a JPEG. |
static void |
writeImageToFile(java.awt.Image img,
java.io.File f)
Writes image to file of type JPEG or GIF based upon the filename extension of file. |
static void |
writeImageToFile(java.awt.Image img,
java.io.File f,
int encoding)
Writes image to file of type JPEG or GIF. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int GIF
public static final int JPEG
| Constructor Detail |
public ImageWriter()
| Method Detail |
public static void writeImageToFile(java.awt.Image img,
java.io.File f)
throws java.io.IOException
img - the java.awt.Image instance to be encoded. For JPEG encoding this object must be an instance of java.awt.image.BufferedImagef - the File to which this graph will be written to
- Throws:
java.io.IOException
public static void writeImageToFile(java.awt.Image img,
java.io.File f,
int encoding)
throws java.io.IOException
img - the java.awt.Image instance to be encoded. For JPEG encoding this object must be an instance of java.awt.image.BufferedImagef - the File to which this graph will be written toencoding - an integer specifying the encoding for the target file. Available formats: GIF, JPEG
- Throws:
java.io.IOException- See Also:
GIF,
JPEG
public static void writeAsGif(java.awt.Image img,
java.io.OutputStream os)
throws java.io.IOException
java.awt.Image on the submitted java.io.OutputStream
as a GIF. Currently uses the the ACME Labs
GIFEncoder.
img - os -
java.io.IOException
public static void writeAsJpeg(java.awt.Image img,
java.io.OutputStream os)
throws java.io.IOException
java.awt.image.BufferedImage on the submitted java.io.OutputStream
as a JPEG.
img - must be an instance of java.awt.image.BufferedImageos -
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||