org.pscode.screenshooter
Class ScreenShooter
java.lang.Object
org.pscode.screenshooter.ScreenShooter
public class ScreenShooter
- extends Object
A class to gain animated screenshots of a portion of the screen.
- Version:
- 2009/12/22
- Author:
- Andrew Thompson
|
Method Summary |
boolean |
areImagesIdentical(BufferedImage image1,
BufferedImage image2)
|
boolean |
areRegionsOfImagesIdentical(BufferedImage image1,
BufferedImage image2,
Rectangle region)
|
void |
compareScreenshots()
|
Vector<ImageSequenceFrame> |
convertScreenshotsToImageSequence(Vector<org.pscode.screenshooter.ScreenshotFrame> frames)
|
Rectangle |
determineBounds(BufferedImage image1,
BufferedImage image2,
int width,
int height)
Determines the bounds of a region of difference between two images. |
Vector<Rectangle> |
getDifferenceBounds()
|
JFrame |
getFrame()
|
float |
getFrameDelay()
|
Rectangle |
getIdenticalBoundingBox(BufferedImage image1,
BufferedImage image2,
int width,
int height)
Starting at the given non-identical pixel, determine a bound box of indentical pixels that contains
both the original non-identical pixel, plus any other connected non-identical pixels. |
byte[] |
getImageAsPngBytes(BufferedImage bi)
|
JPanel |
getPanelOfLabelValues(String[][] params)
|
JDialog |
getRegionPreview()
|
JDialog |
getRegionRefine()
|
BufferedImage |
getScreenshot(Rectangle part)
|
void |
getScreenshots()
|
BufferedImage |
getScreenshotWithoutApp(Rectangle part)
|
BufferedImage |
getScreenshotWithoutApp(Rectangle part,
String message)
|
JPanel |
getUi()
|
static void |
main(String[] args)
|
boolean |
pointIsInRegions(Vector<Rectangle> regions,
Point point)
|
void |
preview()
|
Vector<org.pscode.screenshooter.ScreenshotFrame> |
removeIdenticalFrames()
|
void |
save()
|
void |
saveToFile(File f,
Vector<org.pscode.screenshooter.ScreenshotFrame> frames)
|
void |
setFpsLabel()
|
void |
showAbout()
|
void |
showHelp()
|
void |
stopScreenshots()
|
void |
toDo(String what)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScreenShooter
public ScreenShooter()
throws AWTException
- Throws:
AWTException
showHelp
public void showHelp()
showAbout
public void showAbout()
getPanelOfLabelValues
public JPanel getPanelOfLabelValues(String[][] params)
getFrameDelay
public float getFrameDelay()
save
public void save()
saveToFile
public void saveToFile(File f,
Vector<org.pscode.screenshooter.ScreenshotFrame> frames)
getImageAsPngBytes
public byte[] getImageAsPngBytes(BufferedImage bi)
throws IOException
- Throws:
IOException
removeIdenticalFrames
public Vector<org.pscode.screenshooter.ScreenshotFrame> removeIdenticalFrames()
convertScreenshotsToImageSequence
public Vector<ImageSequenceFrame> convertScreenshotsToImageSequence(Vector<org.pscode.screenshooter.ScreenshotFrame> frames)
getRegionRefine
public JDialog getRegionRefine()
getRegionPreview
public JDialog getRegionPreview()
getUi
public JPanel getUi()
setFpsLabel
public void setFpsLabel()
toDo
public void toDo(String what)
compareScreenshots
public void compareScreenshots()
areRegionsOfImagesIdentical
public boolean areRegionsOfImagesIdentical(BufferedImage image1,
BufferedImage image2,
Rectangle region)
areImagesIdentical
public boolean areImagesIdentical(BufferedImage image1,
BufferedImage image2)
getDifferenceBounds
public Vector<Rectangle> getDifferenceBounds()
pointIsInRegions
public boolean pointIsInRegions(Vector<Rectangle> regions,
Point point)
determineBounds
public Rectangle determineBounds(BufferedImage image1,
BufferedImage image2,
int width,
int height)
- Determines the bounds of a region of difference between two images.
- Returns:
- The bounds of the different region.
getIdenticalBoundingBox
public Rectangle getIdenticalBoundingBox(BufferedImage image1,
BufferedImage image2,
int width,
int height)
- Starting at the given non-identical pixel, determine a bound box of indentical pixels that contains
both the original non-identical pixel, plus any other connected non-identical pixels. This method presumes
the scan was started from top to bottom, left to right, thus it builds the bounding box starting from
the left, then adjusting the top, bottom, and right hand side borders until an identical bounding box
is achieved.
getScreenshotWithoutApp
public BufferedImage getScreenshotWithoutApp(Rectangle part,
String message)
getScreenshotWithoutApp
public BufferedImage getScreenshotWithoutApp(Rectangle part)
getScreenshot
public BufferedImage getScreenshot(Rectangle part)
getFrame
public JFrame getFrame()
main
public static void main(String[] args)
getScreenshots
public void getScreenshots()
stopScreenshots
public void stopScreenshots()
preview
public void preview()