public class ImageHelper
extends java.lang.Object
| Constructor and Description |
|---|
ImageHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.awt.image.BufferedImage |
convertImage2Binary(java.awt.image.BufferedImage image)
A simple method to convert an image to binary or B/W image.
|
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 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. |
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 pixelsBufferedImagepublic 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 convertImage2Binary(java.awt.image.BufferedImage image)
image - input imagepublic static java.awt.Image getClipboardImage()