public class ImageHelper
extends java.lang.Object
Constructor and Description |
---|
ImageHelper() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
cloneImage(java.awt.image.BufferedImage bi)
Clones an image.
|
static java.awt.image.BufferedImage |
convertImage2Binary(java.awt.image.BufferedImage image)
Deprecated.
As of release 1.1, renamed to
convertImageToBinary(BufferedImage image) |
static java.awt.image.BufferedImage |
convertImageToBinary(java.awt.image.BufferedImage image)
A simple method to convert an image to binary or B/W image.
|
static java.awt.image.BufferedImage |
convertImageToGrayscale(java.awt.image.BufferedImage image)
A simple method to convert an image to gray scale.
|
static java.awt.Image |
getClipboardImage()
Gets an image from Clipboard.
|
static java.awt.image.BufferedImage |
getScaledInstance(java.awt.image.BufferedImage image,
int targetWidth,
int targetHeight)
Convenience method that returns a scaled instance of the provided
BufferedImage . |
static javax.imageio.IIOImage |
getScaledInstance(javax.imageio.IIOImage iioSource,
float scale)
Convenience method that returns a scaled instance of the provided
IIOImage . |
static java.awt.image.BufferedImage |
getSubImage(java.awt.image.BufferedImage image,
int x,
int y,
int width,
int height)
A replacement for the standard
BufferedImage.getSubimage method. |
static java.awt.image.BufferedImage |
invertImageColor(java.awt.image.BufferedImage image)
Inverts image color.
|
static java.awt.image.BufferedImage |
rotateImage(java.awt.image.BufferedImage image,
double angle)
Rotates an image.
|
public static java.awt.image.BufferedImage getScaledInstance(java.awt.image.BufferedImage image, int targetWidth, int targetHeight)
BufferedImage
.image
- the original image to be scaledtargetWidth
- the desired width of the scaled instance, in pixelstargetHeight
- the desired height of the scaled instance, in pixelsBufferedImage
public static javax.imageio.IIOImage getScaledInstance(javax.imageio.IIOImage iioSource, float scale)
IIOImage
.iioSource
- the original image to be scaledscale
- the desired scaleIIOImage
public static java.awt.image.BufferedImage getSubImage(java.awt.image.BufferedImage image, int x, int y, int width, int height)
BufferedImage.getSubimage
method.image
- x
- the X coordinate of the upper-left corner of the specified
rectangular regiony
- the Y coordinate of the upper-left corner of the specified
rectangular regionwidth
- the width of the specified rectangular regionheight
- the height of the specified rectangular regionimage
.public static java.awt.image.BufferedImage convertImageToBinary(java.awt.image.BufferedImage image)
image
- input image@Deprecated public static java.awt.image.BufferedImage convertImage2Binary(java.awt.image.BufferedImage image)
convertImageToBinary(BufferedImage image)
image
- input imagepublic static java.awt.image.BufferedImage convertImageToGrayscale(java.awt.image.BufferedImage image)
image
- input imagepublic static java.awt.image.BufferedImage invertImageColor(java.awt.image.BufferedImage image)
image
- input imagepublic static java.awt.image.BufferedImage rotateImage(java.awt.image.BufferedImage image, double angle)
image
- the original imageangle
- the degree of rotationpublic static java.awt.Image getClipboardImage()
public static java.awt.image.BufferedImage cloneImage(java.awt.image.BufferedImage bi)
bi
-