public class ImageTools
extends java.lang.Object
Constructor and Description |
---|
ImageTools() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
crop(int maxwidth,
int maxheight,
java.awt.Image image) |
static java.awt.image.BufferedImage |
crop(int maxwidth,
int maxheight,
java.awt.Image image,
boolean quality) |
static javax.swing.ImageIcon |
loadIcon(java.lang.Class associatedClass,
java.lang.String resourceName)
load an icon
|
static javax.swing.ImageIcon |
loadIconIfExists(java.lang.Class associatedClass,
java.lang.String resourceName)
load icon if exists
|
static java.awt.image.BufferedImage |
loadImage(java.lang.Class associatedClass,
java.lang.String resourcename)
Load an image associated to a class ressource
|
static java.awt.image.BufferedImage |
loadImage(java.io.File file) |
static java.awt.image.BufferedImage |
loadImage(java.awt.Image image) |
static java.awt.image.BufferedImage |
loadImage(java.net.URL url) |
static java.awt.image.BufferedImage |
loadImageAndCrop(java.io.File imageFile,
int maxwidth,
int maxheight) |
static java.awt.image.BufferedImage |
loadImageAndCrop(java.io.InputStream imageFile,
int maxwidth,
int maxheight)
read image stream and crop (warn this method load all the image content in
memory)
|
static java.awt.image.BufferedImage |
loadImageAndCrop(java.net.URL imageUrl,
int maxwidth,
int maxheight)
Load image and reduce it
|
static java.awt.image.BufferedImage |
loadImageIfExists(java.lang.Class associatedClass,
java.lang.String resourcename)
Load an image associated to a class ressource
|
public static java.awt.image.BufferedImage loadImageAndCrop(java.net.URL imageUrl, int maxwidth, int maxheight) throws java.lang.Exception
imageUrl
- the image urlmaxwidth
- maxheight
- java.lang.Exception
public static java.awt.image.BufferedImage loadImageAndCrop(java.io.InputStream imageFile, int maxwidth, int maxheight) throws java.lang.Exception
imageFile
- maxwidth
- maxheight
- java.lang.Exception
public static java.awt.image.BufferedImage loadImageAndCrop(java.io.File imageFile, int maxwidth, int maxheight) throws java.lang.Exception
java.lang.Exception
public static java.awt.image.BufferedImage crop(int maxwidth, int maxheight, java.awt.Image image)
public static java.awt.image.BufferedImage crop(int maxwidth, int maxheight, java.awt.Image image, boolean quality)
public static java.awt.image.BufferedImage loadImage(java.lang.Class associatedClass, java.lang.String resourcename) throws java.lang.Exception
associatedClass
- the associated classresourcename
- the resource namejava.lang.Exception
- an exception is raised if the resource is not found or if
there is a probleme loading the resourcepublic static java.awt.image.BufferedImage loadImageIfExists(java.lang.Class associatedClass, java.lang.String resourcename) throws java.lang.Exception
associatedClass
- the associated classresourcename
- the resource namejava.lang.Exception
- an exception is raised if the resource is not found or if
there is a probleme loading the resourcepublic static javax.swing.ImageIcon loadIcon(java.lang.Class associatedClass, java.lang.String resourceName) throws java.lang.Exception
associatedClass
- resourceName
- java.lang.Exception
public static javax.swing.ImageIcon loadIconIfExists(java.lang.Class associatedClass, java.lang.String resourceName) throws java.lang.Exception
associatedClass
- resourceName
- java.lang.Exception
public static java.awt.image.BufferedImage loadImage(java.net.URL url) throws java.lang.Exception
java.lang.Exception
public static java.awt.image.BufferedImage loadImage(java.io.File file) throws java.lang.Exception
java.lang.Exception
public static java.awt.image.BufferedImage loadImage(java.awt.Image image) throws java.lang.Exception
java.lang.Exception