com.partnersoft.gui
Class Screenshot

java.lang.Object
  extended by com.partnersoft.gui.Screenshot

public class Screenshot
extends java.lang.Object

A tool for taking snapshot images of the desktop.

Copyright 2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
Screenshot()
           
Screenshot(java.awt.Rectangle bounds)
           
Screenshot(java.awt.Window window)
           
 
Method Summary
 java.awt.image.RenderedImage capture()
          Take a single screenshot at the current bounds settings.
 java.awt.Rectangle getBounds()
           
 java.awt.image.BufferedImage getImage()
          Gets the last captured image; if there is none, attempts to take one.
 void setBounds(java.awt.Rectangle newBounds)
           
 void setBoundsToFullScreen()
           
 void setBoundsToWindow(java.awt.Window window)
           
 void writeImageTo(VfsFile file)
          Saves the last capture to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Screenshot

public Screenshot()

Screenshot

public Screenshot(java.awt.Window window)

Screenshot

public Screenshot(java.awt.Rectangle bounds)
Method Detail

setBoundsToFullScreen

public void setBoundsToFullScreen()

setBoundsToWindow

public void setBoundsToWindow(java.awt.Window window)

getImage

public java.awt.image.BufferedImage getImage()
Gets the last captured image; if there is none, attempts to take one.


capture

public java.awt.image.RenderedImage capture()
Take a single screenshot at the current bounds settings. Returns the image, but you can also get that using getImage().


writeImageTo

public void writeImageTo(VfsFile file)
                  throws java.io.IOException
Saves the last capture to the given file. Uses the file extension to determine format.

Throws:
java.io.IOException

getBounds

public java.awt.Rectangle getBounds()

setBounds

public void setBounds(java.awt.Rectangle newBounds)