|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.util.IlvImageUtil
public class IlvImageUtil
This class defines a set of utility methods to load and create images.
| Method Summary | |
|---|---|
static BufferedImage |
createBufferedImage(Image image,
int imageType)
Creates a BufferedImage of the specified type from the given
image. |
static Image |
getImageFromFile(Class loader,
String file)
This is a utility method that creates an image from a file stored in a JAR file. |
static Image |
loadImage(String fileName)
Loads an image from the specified file. |
static BufferedImage |
loadImage(String fileName,
int imageType)
Loads an image from the specified file as a BufferedImage
of the specified type. |
static Image |
loadImage(URL url)
Loads an image from the specified URL. |
static BufferedImage |
loadImage(URL url,
int imageType)
Loads an image from the specified URL as a BufferedImage
of the specified type. |
static Image |
loadImageFromFile(Class loader,
String filename)
Utility method that loads an image from a file stored in a JAR file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Image getImageFromFile(Class loader,
String file)
throws IOException
InputStream
returned by the method getResourceAsStream
called on the loader object.
loader - The Class object on which the method
getResourceAsStream is called.file - The location of the file that contains the image to be read.
The location must be specified according to the location
of the loader class. For details, see the documentation of
Class.getResourceAsStream.
IOException - An exception occurred while trying to read the
bytes defining the image.
public static Image loadImageFromFile(Class loader,
String filename)
throws IOException
loader - The Class object on which the method
getResourceAsStream is called.filename - The location of the file that contains the image to
be read.
The location must be specified according to the location
of the loader class.
null if the loading failed.
IOException - An exception occurred while trying to read the
bytes defining the image.getImageFromFile(java.lang.Class, java.lang.String)
public static BufferedImage createBufferedImage(Image image,
int imageType)
BufferedImage of the specified type from the given
image.
image - The original image.imageType - The type of the image to create. It can be any of the
predefined image types defined in the
java.awt.image.BufferedImage class.public static Image loadImage(URL url)
url - The URL of the image.
null if the loading failed.public static Image loadImage(String fileName)
fileName - The image file name.
null if the loading failed.
public static BufferedImage loadImage(String fileName,
int imageType)
BufferedImage
of the specified type.
fileName - The image file name.imageType - The type of the image to create. It can be any of the
predefined image types defined in the
java.awt.image.BufferedImage class.
null if the loading failed.
public static BufferedImage loadImage(URL url,
int imageType)
BufferedImage
of the specified type.
url - The URL of the image.imageType - The type of the image to create. It can be any of the
predefined image types defined in the
java.awt.image.BufferedImage class.
null if the loading failed.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||