Interface DesktopInteract

  • All Known Implementing Classes:
    DesktopInteractImpl

    public interface DesktopInteract
    Interface to capture desktop screen.
    Author:
    Sebastien Vincent
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      BufferedImage captureScreen()
      Capture the full desktop screen.
      boolean captureScreen​(int display, byte[] output)
      Capture the full desktop screen using native grabber.
      BufferedImage captureScreen​(int x, int y, int width, int height)
      Capture a part of the desktop screen.
      boolean captureScreen​(int display, int x, int y, int width, int height, byte[] output)
      Capture a part of the desktop screen using native grabber.
      boolean captureScreen​(int display, int x, int y, int width, int height, long buffer, int bufferLength)
      Capture a part of the desktop screen using native grabber.
      boolean captureScreen​(int display, long buffer, int bufferLength)
      Capture the full desktop screen using native grabber.
    • Method Detail

      • captureScreen

        boolean captureScreen​(int display,
                              byte[] output)
        Capture the full desktop screen using native grabber. Contrary to other captureScreen method, it only returns raw bytes and not BufferedImage. It is done in order to limit slow operation such as converting ARGB images (uint32_t) to bytes especially for big big screen. For example a 1920x1200 desktop consumes 9 MB of memory for grabbing and another 9 MB array for conversion operation.
        Parameters:
        display - index of display
        output - output buffer to store bytes in. Be sure that output length is sufficient
        Returns:
        true if success, false if JNI error or output length too short
      • captureScreen

        boolean captureScreen​(int display,
                              long buffer,
                              int bufferLength)
        Capture the full desktop screen using native grabber. Contrary to other captureScreen method, it only returns raw bytes and not BufferedImage. It is done in order to limit slow operation such as converting ARGB images (uint32_t) to bytes especially for big big screen. For example a 1920x1200 desktop consumes 9 MB of memory for grabbing and another 9 MB array for conversion operation.
        Parameters:
        display - index of display
        buffer - native output buffer to store bytes in. Be sure that output length is sufficient
        bufferLength - length of native buffer
        Returns:
        true if success, false if JNI error or output length too short
      • captureScreen

        boolean captureScreen​(int display,
                              int x,
                              int y,
                              int width,
                              int height,
                              byte[] output)
        Capture a part of the desktop screen using native grabber. Contrary to other captureScreen method, it only returns raw bytes and not BufferedImage. It is done in order to limit slow operation such as converting ARGB images (uint32_t) to bytes especially for big big screen. For example a 1920x1200 desktop consumes 9 MB of memory for grabbing and another 9 MB array for conversion operation.
        Parameters:
        display - index of display
        x - x position to start capture
        y - y position to start capture
        width - capture width
        height - capture height
        output - output buffer to store bytes in. Be sure that output length is sufficient
        Returns:
        true if success, false if JNI error or output length too short
      • captureScreen

        boolean captureScreen​(int display,
                              int x,
                              int y,
                              int width,
                              int height,
                              long buffer,
                              int bufferLength)
        Capture a part of the desktop screen using native grabber. Contrary to other captureScreen method, it only returns raw bytes and not BufferedImage. It is done in order to limit slow operation such as converting ARGB images (uint32_t) to bytes especially for big big screen. For example a 1920x1200 desktop consumes 9 MB of memory for grabbing and another 9 MB array for conversion operation.
        Parameters:
        display - index of display
        x - x position to start capture
        y - y position to start capture
        width - capture width
        height - capture height
        buffer - native output buffer to store bytes in. Be sure that output length is sufficient
        bufferLength - length of native buffer
        Returns:
        true if success, false if JNI error or output length too short
      • captureScreen

        BufferedImage captureScreen()
        Capture the full desktop screen.
        Returns:
        BufferedImage of the desktop screen
      • captureScreen

        BufferedImage captureScreen​(int x,
                                    int y,
                                    int width,
                                    int height)
        Capture a part of the desktop screen.
        Parameters:
        x - x position to start capture
        y - y position to start capture
        width - capture width
        height - capture height
        Returns:
        BufferedImage of a part of the desktop screen or null if Robot problem