public class ScreenCapture
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.List<java.lang.String> |
types |
Constructor and Description |
---|
ScreenCapture() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
captureDesktopImage()
Convenience method to create a BufferedImage of the desktop
|
static java.awt.image.BufferedImage |
captureDesktopImage(java.awt.Rectangle region)
Create a BufferedImage from a rectangular region on the screen.
|
static java.awt.image.BufferedImage |
captureImage(java.awt.Component component) |
static java.awt.image.BufferedImage |
captureImage(javax.swing.JComponent component) |
static java.awt.image.BufferedImage |
captureImage(javax.swing.JComponent component,
java.awt.Rectangle region) |
(package private) static void |
layoutComponent(java.awt.Component component) |
static void |
writeImage(java.awt.image.BufferedImage image,
java.lang.String fileName)
Write a BufferedImage to a File.
|
public static java.awt.image.BufferedImage captureDesktopImage() throws java.awt.AWTException
java.awt.AWTException
- see Robot class constructorspublic static java.awt.image.BufferedImage captureDesktopImage(java.awt.Rectangle region) throws java.awt.AWTException
region
- region on the screen to create image fromjava.awt.AWTException
- see Robot class constructorspublic static java.awt.image.BufferedImage captureImage(java.awt.Component component) throws java.awt.AWTException
java.awt.AWTException
public static java.awt.image.BufferedImage captureImage(javax.swing.JComponent component)
public static java.awt.image.BufferedImage captureImage(javax.swing.JComponent component, java.awt.Rectangle region)
static void layoutComponent(java.awt.Component component)
public static void writeImage(java.awt.image.BufferedImage image, java.lang.String fileName) throws java.io.IOException
image
- image to be writtenfileName
- name of file to be createdjava.io.IOException
- if an error occurs during writing