-
Bug
-
Resolution: Duplicate
-
P4
-
8, 11, 17, 21, 22
-
x86_64
-
linux_debian_3.0
ADDITIONAL SYSTEM INFORMATION :
Tried on Debian11 (bullseye) and Debian10 (buster) with default Gnome3 desktop
On Debian11 tried with these openjdk java versions:
- "17-ea" 2021-09-14
- "14.0.2" 2020-07-14
- "13.0.5.1" 2020-11-06
- "11.0.11" 2021-04-20
A DESCRIPTION OF THE PROBLEM :
When I try to take a screenshot using java.awt.Robot, then in any case this produces just a black image.
Same bad result using javafx.scene.robot.Robot.
Also getPixelColor​(x,y) always returns black.
But getPixelColor​(x,y) returns any wrong color, when this argument is set: -Dawt.robot.gtk=false
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just try to take a screenshot on any Debian OS with Gnome3, it is always black.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
This function should return an Image containing the recorded screenshot.
ACTUAL -
Black image.
---------- BEGIN SOURCE ----------
public class Test
{
public static void main (String args[]) throws Exception
{
java.awt.Robot robot = new java.awt.Robot();
java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
java.awt.Rectangle rect = new java.awt.Rectangle(tk.getScreenSize());
java.awt.image.BufferedImage im = robot.createScreenCapture(rect);
javax.imageio.ImageIO.write(im, "png", new java.io.File("/tmp/screen.png"));
}
}
---------- END SOURCE ----------
FREQUENCY : always
Tried on Debian11 (bullseye) and Debian10 (buster) with default Gnome3 desktop
On Debian11 tried with these openjdk java versions:
- "17-ea" 2021-09-14
- "14.0.2" 2020-07-14
- "13.0.5.1" 2020-11-06
- "11.0.11" 2021-04-20
A DESCRIPTION OF THE PROBLEM :
When I try to take a screenshot using java.awt.Robot, then in any case this produces just a black image.
Same bad result using javafx.scene.robot.Robot.
Also getPixelColor​(x,y) always returns black.
But getPixelColor​(x,y) returns any wrong color, when this argument is set: -Dawt.robot.gtk=false
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just try to take a screenshot on any Debian OS with Gnome3, it is always black.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
This function should return an Image containing the recorded screenshot.
ACTUAL -
Black image.
---------- BEGIN SOURCE ----------
public class Test
{
public static void main (String args[]) throws Exception
{
java.awt.Robot robot = new java.awt.Robot();
java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
java.awt.Rectangle rect = new java.awt.Rectangle(tk.getScreenSize());
java.awt.image.BufferedImage im = robot.createScreenCapture(rect);
javax.imageio.ImageIO.write(im, "png", new java.io.File("/tmp/screen.png"));
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8298101 Robot.createScreenCapture() cause frame block on uos(kirin cpu) linux
- Closed
-
JDK-8280982 [Wayland] [XWayland] java.awt.Robot taking screenshots
- Resolved
- relates to
-
JDK-8225118 Robot.createScreenCapture() returns black image on HiDPI linux with gtk3
- Resolved
-
JDK-8022403 sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java fails
- Resolved