JDK-8119517 : Mac: GlassRobot gets a wrong screenshot for Mac OS X (LoDPI, HiDPI)
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-02-08
  • Updated: 2015-06-17
  • Resolved: 2013-03-07
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.
JDK 8
8Fixed
Related Reports
Relates :  
Relates :  
Description
Please take a look at the simple attached test & screenshots from Win7, Mac OS X win LoDPI (a usual display) and HiDPI (retina) emulation (by Quartz Debug).
Comments
Fixed together with RT-28284.
07-03-2013

An image returned by CGWindowListCreateImage() may have more bytes-per-raw than just width*4, so the code that just copies it to the java buffer may produce incorrect results. The fix is to wrap the java buffer with a Quartz image of a proper format and draw the screenshot into it. This resolves the issue.
12-02-2013

There are several problems with the getScreenCapture() on the Mac. One of them is that we copied 4 times less data than required (a missing *4 in memcpy()). After fixing this, I get the full image. However, it's still is kind of shifted. I'm investigating this now.
12-02-2013