org.netbeans.jemmy.image
Class ImageTool

java.lang.Object
  extended by org.netbeans.jemmy.image.ImageTool

public class ImageTool
extends java.lang.Object

Contains util methods to work with images.

Author:
Alexandre Iline (alexandre.iline@sun.com)

Constructor Summary
ImageTool()
           
 
Method Summary
static java.awt.image.BufferedImage enlargeImage(java.awt.image.BufferedImage image, int zoom)
          Increases image.
static java.awt.image.BufferedImage getImage()
          Gets the whole screen image.
static java.awt.image.BufferedImage getImage(java.awt.Component comp)
          Gets an image from a component.
static java.awt.image.BufferedImage getImage(java.awt.Rectangle rect)
          Gets an image from a rectange on screen.
static java.awt.image.BufferedImage substractImage(java.awt.image.BufferedImage minuend, java.awt.image.BufferedImage deduction)
          Deprecated. Use subtractImage(BufferedImage, BufferedImage) instead.
static java.awt.image.BufferedImage substractImage(java.awt.image.BufferedImage minuend, java.awt.image.BufferedImage deduction, int relativeX, int relativeY)
          Deprecated. Use subtractImage(BufferedImage, BufferedImage, int, int) instead.
static java.awt.image.BufferedImage subtractImage(java.awt.image.BufferedImage minuend, java.awt.image.BufferedImage deduction)
          Subtracts second image from first one.
static java.awt.image.BufferedImage subtractImage(java.awt.image.BufferedImage minuend, java.awt.image.BufferedImage deduction, int relativeX, int relativeY)
          Subtracts subimage from image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageTool

public ImageTool()
Method Detail

getImage

public static java.awt.image.BufferedImage getImage(java.awt.Rectangle rect)
Gets an image from a rectange on screen.

Parameters:
rect - a rectangle on screen in absolute screen coordinates.
Returns:
a captured image.

getImage

public static java.awt.image.BufferedImage getImage(java.awt.Component comp)
Gets an image from a component.

Parameters:
comp - a visible component.
Returns:
a captured image.

getImage

public static java.awt.image.BufferedImage getImage()
Gets the whole screen image.

Returns:
a captured image.

enlargeImage

public static java.awt.image.BufferedImage enlargeImage(java.awt.image.BufferedImage image,
                                                        int zoom)
Increases image.

Parameters:
image - an image to enlarge.
zoom - A scale.
Returns:
a result image.

substractImage

public static java.awt.image.BufferedImage substractImage(java.awt.image.BufferedImage minuend,
                                                          java.awt.image.BufferedImage deduction)
Deprecated. Use subtractImage(BufferedImage, BufferedImage) instead.

Parameters:
minuend - an image to subtract from.
deduction - an image to subtract.
Returns:
a result image.

subtractImage

public static java.awt.image.BufferedImage subtractImage(java.awt.image.BufferedImage minuend,
                                                         java.awt.image.BufferedImage deduction)
Subtracts second image from first one. Could be used to save file difference for future analysis.

Parameters:
minuend - an image to subtract from.
deduction - an image to subtract.
Returns:
a result image.

substractImage

public static java.awt.image.BufferedImage substractImage(java.awt.image.BufferedImage minuend,
                                                          java.awt.image.BufferedImage deduction,
                                                          int relativeX,
                                                          int relativeY)
Deprecated. Use subtractImage(BufferedImage, BufferedImage, int, int) instead.

Parameters:
minuend - an image to subtract from.
deduction - an image to subtract.
Returns:
a result image.

subtractImage

public static java.awt.image.BufferedImage subtractImage(java.awt.image.BufferedImage minuend,
                                                         java.awt.image.BufferedImage deduction,
                                                         int relativeX,
                                                         int relativeY)
Subtracts subimage from image. Could be used to save file difference for future analysis.

Parameters:
minuend - an image to subtract from.
deduction - an image to subtract.
relativeX - - deduction-in-minuend X coordinate
relativeY - - deduction-in-minuend Y coordinate
Returns:
a result image.