JDK-8020618 : [macosx] java.awt.Robot makes blurry screen captures on Retina
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u40
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • Submitted: 2013-07-11
  • Updated: 2018-04-28
  • Resolved: 2018-04-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_majorResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version  " 1.7.0_40-ea " 
Java(TM) SE Runtime Environment (build 1.7.0_40-ea-b28)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b47, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Darwin munit-065 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64

EXTRA RELEVANT SYSTEM CONFIGURATION :
MacBook Pro
Retina, 13-inch, Late 2012
Processor  2.9 GHz Intel Core i7
Memory  8 GB 1600 MHz DDR3
Graphics  Intel HD Graphics 4000 768 MB
Software  OS X 10.8.4 (12E55)

A DESCRIPTION OF THE PROBLEM :
createScreenCapture method of java.awt.Robot makes blurry screen captures on Retina devices

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try {
  Robot robot = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
  BufferedImage capture = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
  ImageIO.write(capture,  " png " , new File( " /tmp/capture.png " ));
} catch (Exception ignore) {}


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
On Retina device I expect 600x600 image with exactly the same picture that I see on Retina display

http://bulenkov.com/images/retina-capture.png
ACTUAL -
[0,0,600,600] was captured and saved into 300x300 image

http://bulenkov.com/images/robot-capture.png

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
try {
  Robot robot = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
  BufferedImage capture = robot.createScreenCapture(new Rectangle(0, 0, 300, 300));
  ImageIO.write(capture,  " png " , new File( " /tmp/capture.png " ));
} catch (Exception ignore) {}
---------- END SOURCE ----------
Comments
New method which creates a screen capture and returns a MultiResolutionImage should be added.
29-09-2016

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

Can we return MRI in this case?
07-07-2014