|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ccl.swing.GraphicsUtil
Support class for graphics stuff, like for example saving jpeg images.
Method Summary | |
static java.awt.image.BufferedImage |
componentToImage(java.awt.Component component,
java.awt.Container container)
Creates an image of the component. |
static java.awt.image.BufferedImage |
createBufferedImage(java.awt.Image image)
Creates a buffered image out of the given image. |
static java.awt.image.BufferedImage |
crop(java.awt.image.BufferedImage bufferedImage,
int x,
int y,
int width,
int height)
Creates a new buffer image by cropping out a part of the given image. |
static java.awt.image.BufferedImage |
crop(java.awt.Image image,
int x,
int y,
int width,
int height)
Creates a new buffer image by cropping out a part of the given image. |
static boolean |
equals(java.awt.image.BufferedImage imageA,
java.awt.image.BufferedImage imageB)
Compares two images pixel by pixel. |
static boolean |
equals(javax.swing.ImageIcon iconA,
javax.swing.ImageIcon iconB)
Compares two images pixel by pixel. |
static boolean |
equals(java.awt.Image imageA,
java.awt.Image imageB)
Compares two images pixel by pixel. |
static void |
saveComponentAsJpeg(java.lang.String filename,
java.awt.Component component,
java.awt.Container container)
Deprecated. #saveComponentAsJPEG |
static void |
saveComponentAsJPEG(java.lang.String filename,
java.awt.Component component,
java.awt.Container container)
Creates an image of the component and saves it in jpeg format. |
static void |
saveImageAsGIF(java.lang.String filename,
java.awt.image.BufferedImage image)
Saves a buffered image as a gif file. |
static void |
saveImageAsGIF(java.lang.String filename,
java.awt.Image image)
Saves image object as gif file. |
static void |
saveImageAsJpeg(java.lang.String filename,
java.awt.image.BufferedImage bufferedImage)
Deprecated. #saveImageAsJPEG |
static void |
saveImageAsJPEG(java.lang.String filename,
java.awt.image.BufferedImage bufferedImage)
Saves image object as jpeg file. |
static void |
saveImageAsJpeg(java.lang.String filename,
java.awt.Image image)
Deprecated. #saveImageAsJPEG |
static void |
saveImageAsJPEG(java.lang.String filename,
java.awt.Image image)
Saves image object as jpeg file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void saveImageAsJpeg(java.lang.String filename, java.awt.Image image) throws java.io.IOException
Thanks to Marco Schmidt for his example code.
java.io.IOException
public static void saveImageAsJPEG(java.lang.String filename, java.awt.Image image) throws java.io.IOException
Thanks to Marco Schmidt for his example code.
java.io.IOException
public static void saveImageAsJpeg(java.lang.String filename, java.awt.image.BufferedImage bufferedImage) throws java.io.IOException
Thanks to Marco Schmidt for his example code.
java.io.IOException
public static void saveImageAsJPEG(java.lang.String filename, java.awt.image.BufferedImage bufferedImage) throws java.io.IOException
Thanks to Marco Schmidt for his example code.
java.io.IOException
public static void saveComponentAsJpeg(java.lang.String filename, java.awt.Component component, java.awt.Container container) throws java.io.IOException
Taken from Lawrence H. Rodrigues: Building Imaging Applications with Java Technology.
java.io.IOException
public static void saveComponentAsJPEG(java.lang.String filename, java.awt.Component component, java.awt.Container container) throws java.io.IOException
Taken from Lawrence H. Rodrigues: Building Imaging Applications with Java Technology.
java.io.IOException
public static java.awt.image.BufferedImage componentToImage(java.awt.Component component, java.awt.Container container) throws java.io.IOException
container
- e.g. jframe.getContentPane().
java.io.IOException
public static java.awt.image.BufferedImage crop(java.awt.Image image, int x, int y, int width, int height)
public static java.awt.image.BufferedImage crop(java.awt.image.BufferedImage bufferedImage, int x, int y, int width, int height)
public static void saveImageAsGIF(java.lang.String filename, java.awt.image.BufferedImage image) throws java.io.IOException
filename
- the file name will be normalized, which means the
current user dir will be taken into account if
necessary.
java.io.IOException
- if writing the file fails.public static void saveImageAsGIF(java.lang.String filename, java.awt.Image image) throws java.io.IOException
filename
- the file name will be normalized, which means the
current user dir will be taken into account if
necessary.
Thanks to Marco Schmidt for his example code.
java.io.IOException
public static java.awt.image.BufferedImage createBufferedImage(java.awt.Image image)
public static boolean equals(javax.swing.ImageIcon iconA, javax.swing.ImageIcon iconB)
public static boolean equals(java.awt.Image imageA, java.awt.Image imageB)
public static boolean equals(java.awt.image.BufferedImage imageA, java.awt.image.BufferedImage imageB)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |