net.sourceforge.vietocr
Class ImageHelper
java.lang.Object
net.sourceforge.vietocr.ImageHelper
public class ImageHelper
- extends java.lang.Object
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImageHelper
public ImageHelper()
getScaledInstance
public 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
.
- Parameters:
image
- the original image to be scaledtargetWidth
- the desired width of the scaled instance,
in pixelstargetHeight
- the desired height of the scaled instance,
in pixels
- Returns:
- a scaled version of the original
BufferedImage
getSubImage
public 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.
- Parameters:
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 region
- Returns:
- a BufferedImage that is the subimage of
image
.
getClipboardImage
public static java.awt.Image getClipboardImage()
- Gets an image from Clipboard.
- Returns:
- image