Window without involving the operating
system's window manager.-
Method Summary
Modifier and TypeMethodDescriptiongetWindowBackbufferArea(Window window, int x, int y, int width, int height) Returns a snapshot of the window's client area from its backbuffer, if any.getWindowSurfaceArea(Window window, int x, int y, int width, int height) Captures the specified area of the client region of a givenwindowfrom its underlying pixel representation, and returns it as an image.
-
Method Details
-
getWindowBackbufferArea
Returns a snapshot of the window's client area from its backbuffer, if any. If
windowhas no associated backbuffer,nullis returned.Note: the use of the backbuffer is primarily controlled by the
swing.bufferPerWindowsystem property (trueby default).The coordinates and size are given in the window's client area coordinate system, which is the area of a window not covered by the window's decorations such as the system title bar. The pixel with the coordinates
(x, y)of the window's client area will be at(0, 0)in the returned image.widthandheightare clipped to the window's client area, soInteger.MAX_VALUEcan be used safely.IllegalArgumentExceptionis thrown if either of the following holds:widthorheightis negative or zero.xoryare outside the window's client area.
- Parameters:
window- window to take a screenshot of; must not benullx- x coordinate within the window's client areay- y coordinate within the window's client areawidth- width of the screenshot; clipped to the window's client areaheight- height of the screenshot; clipped to the window's client area- Returns:
- a snapshot of the window's client area from the window's backbuffer, if any.
nullif the window has no backbuffer or if the window is not visible. The returned image is a copy of the image in the buffer strategy, so the caller can modify it.
-
getWindowSurfaceArea
Captures the specified area of the client region of a given
windowfrom its underlying pixel representation, and returns it as an image.The coordinates and size are given in the window's client area coordinate system, which is the area of a window not covered by the window's decorations such as the system title bar. The pixel with the coordinates
(x, y)of the window's client area will be at(0, 0)in the returned image.IllegalArgumentExceptionis thrown if either of the following holds:widthorheightis negative or zero.xoryare outside the window's client area.
Note: Currently available only on Linux with WLToolkit.
- Parameters:
window- window to take a screenshot of; must not benullx- x coordinate within the window's client areay- y coordinate within the window's client areawidth- width of the area to screenshot; clipped to the window's client areaheight- height of the area to screenshot; clipped to the window's client area- Returns:
- a snapshot of the window's client area from its underlying graphics subsystem representation.
nullif the window is not visible. Since the actual pixels of the window may be scaled depending on Java or operating system settings, the size of the returned image may differ fromwidthandheight. The returned image is a copy, so the caller can modify it.
-