ur_rna.GUITester.GuiTools

## Class ScreenCapture

- java.lang.Object
- - ur_rna.GUITester.GuiTools.ScreenCapture

-     public class ScreenCapture
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.util.List<java.lang.String>` | `types`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScreenCapture()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### types

          private static java.util.List<java.lang.String> types

  - ### Constructor Detail

    - #### ScreenCapture

          public ScreenCapture()

  - ### Method Detail

    - #### captureDesktopImage

          public static java.awt.image.BufferedImage captureDesktopImage()
                                                                  throws java.awt.AWTException

      Convenience method to create a BufferedImage of the desktop
      Returns:
        image the image for the given region
      Throws:
        `java.awt.AWTException` - see Robot class constructors

    - #### captureDesktopImage

          public static java.awt.image.BufferedImage captureDesktopImage(java.awt.Rectangle region)
                                                                  throws java.awt.AWTException

      Create a BufferedImage from a rectangular region on the screen. This will include Swing components JFrame, JDialog and JWindow which all extend from Component, not JComponent.
      Parameters:
        `region` - region on the screen to create image from
      Returns:
        image the image for the given region
      Throws:
        `java.awt.AWTException` - see Robot class constructors

    - #### captureImage

          public static java.awt.image.BufferedImage captureImage(java.awt.Component component)
                                                           throws java.awt.AWTException

      Throws:
        `java.awt.AWTException`

    - #### captureImage

          public static java.awt.image.BufferedImage captureImage(javax.swing.JComponent component)

    - #### captureImage

          public static java.awt.image.BufferedImage captureImage(javax.swing.JComponent component,
                                                                  java.awt.Rectangle region)

    - #### layoutComponent

          static void layoutComponent(java.awt.Component component)

    - #### writeImage

          public static void writeImage(java.awt.image.BufferedImage image,
                                        java.lang.String fileName)
                                 throws java.io.IOException

      Write a BufferedImage to a File.
      Parameters:
        `image` - image to be written
        `fileName` - name of file to be created
      Throws:
        `java.io.IOException` - if an error occurs during writing