public class ScreenshotRobot
extends java.lang.Object
Constructor and Description |
---|
ScreenshotRobot()
Initializes a ScreenshotRobot.
|
Modifier and Type | Method and Description |
---|---|
void |
configureArea(int screen)
Sets the Rectangle "area" depending on which monitor is specified.
|
void |
createBufferedImage()
Creates a BufferedImage of the Rectangle "area" and stores it into "bi".
|
java.awt.Rectangle |
getArea() |
java.awt.image.BufferedImage |
getBI() |
java.awt.GraphicsDevice[] |
getMonitors() |
void |
init()
(Re-)Initializes the ScreenshotRobot.
|
void |
save(java.io.File f)
Saves the current content of bi into the passed File in .png format.
|
void |
setArea(java.awt.Rectangle area) |
void |
setAreaManually(int x,
int y,
int width,
int height)
Sets area to the specified position and size.
|
void |
setAreaManually(java.awt.Rectangle area)
Sets area to the specified Rectangle.
|
void |
setBI(java.awt.image.BufferedImage bi) |
void |
setMonitors(java.awt.GraphicsDevice[] monitors) |
public void init()
public void configureArea(int screen)
screen
- 0 for all monitors, else monitor number starting with 1 for main monitor.public void setAreaManually(java.awt.Rectangle area)
area
- any area within the screen size.public void setAreaManually(int x, int y, int width, int height)
x
- the upper left x position of the new screen area.y
- the upper left y position of the new screen area.width
- the width of the new screen area.height
- the height of the new screen area.public void createBufferedImage()
public void save(java.io.File f)
f
- the fie to store to.public java.awt.GraphicsDevice[] getMonitors()
public java.awt.Rectangle getArea()
public java.awt.image.BufferedImage getBI()
public void setMonitors(java.awt.GraphicsDevice[] monitors)
public void setArea(java.awt.Rectangle area)
public void setBI(java.awt.image.BufferedImage bi)