Interface DesktopInteract
-
- All Known Implementing Classes:
DesktopInteractImpl
public interface DesktopInteractInterface to capture desktop screen.- Author:
- Sebastien Vincent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BufferedImagecaptureScreen()Capture the full desktop screen.booleancaptureScreen(int display, byte[] output)Capture the full desktop screen using native grabber.BufferedImagecaptureScreen(int x, int y, int width, int height)Capture a part of the desktop screen.booleancaptureScreen(int display, int x, int y, int width, int height, byte[] output)Capture a part of the desktop screen using native grabber.booleancaptureScreen(int display, int x, int y, int width, int height, long buffer, int bufferLength)Capture a part of the desktop screen using native grabber.booleancaptureScreen(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 displayoutput- 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 displaybuffer- native output buffer to store bytes in. Be sure that output length is sufficientbufferLength- 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 displayx- x position to start capturey- y position to start capturewidth- capture widthheight- capture heightoutput- 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 displayx- x position to start capturey- y position to start capturewidth- capture widthheight- capture heightbuffer- native output buffer to store bytes in. Be sure that output length is sufficientbufferLength- 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 capturey- y position to start capturewidth- capture widthheight- capture height- Returns:
- BufferedImage of a part of the desktop screen or null if Robot problem
-
-