com.ezware.oxbow.swingbits.graphics
Class Screenshot

java.lang.Object
  extended by com.ezware.oxbow.swingbits.graphics.Screenshot

public class Screenshot
extends Object


Method Summary
static Screenshot capture(int width, int height)
           
static Screenshot capture(Rectangle screenRect)
          Creates an image containing pixels read from the screen.
static List<DisplayMode> getDisplayInfo()
          Retrieves screen information as a list of display modes, which includes screen dimensions, bit depth and refresh rate
 Image getImage()
          Returns the image screenshot is based on
 boolean store(String formatName, File output)
          Writes an image using an arbitrary ImageWriter that supports the given format to a File.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

capture

public static final Screenshot capture(Rectangle screenRect)
                                throws AWTException
Creates an image containing pixels read from the screen. This image does not include the mouse cursor.

Parameters:
screenRect - Rect to capture in screen coordinates
Returns:
captured screenshot
Throws:
IllegalArgumentException - if screenRect width and height are not greater than zero
SecurityException - if readDisplayPixels permission is not granted
AWTException
See Also:
SecurityManager.checkPermission(java.security.Permission), AWTPermission

capture

public static final Screenshot capture(int width,
                                       int height)
                                throws AWTException
Throws:
AWTException

getImage

public Image getImage()
Returns the image screenshot is based on


store

public boolean store(String formatName,
                     File output)
              throws IOException
Writes an image using an arbitrary ImageWriter that supports the given format to a File. If there is already a File present, its contents are discarded.

Parameters:
formatName - a String containg the informal name of the format.
output - a File to be written to if an error occurs during writing.
Throws:
IllegalArgumentException - if any parameter is null.
IOException - if an error occurs during writing.

getDisplayInfo

public static final List<DisplayMode> getDisplayInfo()
Retrieves screen information as a list of display modes, which includes screen dimensions, bit depth and refresh rate

Returns:


Copyright © 2011. All Rights Reserved.