|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.swing.image.ScreenshotTaker
public class ScreenshotTaker
Understands taking screenshots of the desktop and GUI components.
Field Summary | |
---|---|
static String |
PNG_EXTENSION
Deprecated. use instead. |
Constructor Summary | |
---|---|
ScreenshotTaker()
Creates a new . |
Method Summary | |
---|---|
void |
saveComponentAsPng(Component c,
String imageFilePath)
Takes a screenshot of the given and saves it as a PNG file. |
void |
saveDesktopAsPng(String imageFilePath)
Takes a screenshot of the desktop and saves it as a PNG file. |
void |
saveImage(BufferedImage image,
String filePath)
Save the given image as a PNG file. |
BufferedImage |
takeDesktopScreenshot()
Takes a screenshot of the desktop. |
BufferedImage |
takeScreenshotOf(Component c)
Takes a screenshot of the given . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final String PNG_EXTENSION
ImageFileExtensions.PNG
instead.
Constructor Detail |
---|
public ScreenshotTaker()
ScreenshotTaker
.
ImageException
- if a AWT Robot (the responsible for taking screenshots) cannot be instantiated.Method Detail |
---|
public void saveDesktopAsPng(String imageFilePath)
imageFilePath
- the path of the file to save the screenshot to.
ImageException
- if the given file path is null
or empty.
ImageException
- if the given file path does not end with ".png".
ImageException
- if the given file path belongs to a non-empty directory.
ImageException
- if an I/O error prevents the image from being saved as a file.public BufferedImage takeDesktopScreenshot()
SecurityException
- if readDisplayPixels
permission is not granted.public void saveComponentAsPng(Component c, String imageFilePath)
Component
and saves it as a PNG file.
c
- the given component.imageFilePath
- the path of the file to save the screenshot to.
ImageException
- if the given file path is null
or empty.
ImageException
- if the given file path does not end with ".png".
ImageException
- if the given file path belongs to a non-empty directory.
ImageException
- if an I/O error prevents the image from being saved as a file.public BufferedImage takeScreenshotOf(Component c)
Component
.
c
- the given component.
SecurityException
- if readDisplayPixels
permission is not granted.public void saveImage(BufferedImage image, String filePath)
image
- the image to save.filePath
- the path of the file to save the image to.
ImageException
- if the given file path is null
or empty.
ImageException
- if the given file path does not end with ".png".
ImageException
- if the given file path belongs to a non-empty directory.
ImageException
- if an I/O error prevents the image from being saved as a file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |