teamdev.jxdesktop
Class CaptureUtilities

java.lang.Object
  extended byteamdev.jxdesktop.CaptureUtilities

public abstract class CaptureUtilities
extends java.lang.Object

A collection of utility methods for desktop.


Constructor Summary
protected CaptureUtilities()
           
 
Method Summary
abstract  java.awt.image.BufferedImage createScreenCapture(java.awt.Rectangle screenRect)
          Creates an image containing pixels read from the screen.
abstract  java.awt.image.BufferedImage createScreenCapture(UIElement element)
          Creates an image containing pixels read from specified UIElement.
abstract  boolean createScreenCaptureAndSaveToFile(java.awt.Rectangle screenRect, java.lang.String imageType, java.io.File outputFile)
          Creates an image containing pixels read from the screen and saves to a specified file in specified type.
static CaptureUtilities getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaptureUtilities

protected CaptureUtilities()
Method Detail

getInstance

public static CaptureUtilities getInstance()

createScreenCapture

public abstract java.awt.image.BufferedImage createScreenCapture(java.awt.Rectangle screenRect)
Creates an image containing pixels read from the screen.

Parameters:
screenRect - rect to capture in screen coordinates
Returns:
The captured image
Throws:
java.lang.IllegalArgumentException - if screenRect width and height are not greater than zero or more than screen size

createScreenCapture

public abstract java.awt.image.BufferedImage createScreenCapture(UIElement element)
Creates an image containing pixels read from specified UIElement.

Parameters:
element - specified UIElement
Returns:
The captured image

createScreenCaptureAndSaveToFile

public abstract boolean createScreenCaptureAndSaveToFile(java.awt.Rectangle screenRect,
                                                         java.lang.String imageType,
                                                         java.io.File outputFile)
Creates an image containing pixels read from the screen and saves to a specified file in specified type.

Parameters:
screenRect - rect to capture in screen coordinates
imageType - type of image. Possible values: "PNG", "JPEG", "GIF" or "BMP"
outputFile - a file in which the image will be saved
Returns:
TRUE if operation successfully completed, othewise - FALSE