JDK-8222012 : Robot ScreenCapture captures a zoomed image
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u171
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2019-04-03
  • Updated: 2019-12-17
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
8-poolUnresolved
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windos 10 en
jre 8u192


A DESCRIPTION OF THE PROBLEM :
Robot ScreenCapture captures a zoomed image

Tested the bug JDK-8204508 and it's not fixed in java u192!

the result is a "zoomed" image and because it's zoomed is cutted

-------------------------------
description in bug JDK-8204508:
------------------------------

When using Robot#createScreenCapture(...) on a HiDpi system the wrong area is captured. The issue occurs only if: 
- the application runs on a HiDpi system 
- the application is started with Webstart 
- the system property 'sun.java2d.dpiaware' is set to 'false' 

A simple test can be found below - you can also give it a try by executing http://www.jyloo.com/downloads/public/test/robotScreenTest.jnlp. When pressing the ScreenCaptureNow button a screen capture of the yellow rectangle is made and displayed in a new window. On a HiDpi system the captured area is wrong.

------------------------------


Important to say that Windows option "Scale and Layout" must be configured above 100%!

It's not necessary a HIDPI monitor to test this...use a 1920x1080 monitor with "Scale and Layout" set  to 125% 

Because  property "sun.java2d.dpiaware=false" in jnlp is not working  in u192 (JDK-8080153, JDK-8155579)
the property must to be forced in the javaws.exe.
Go to "system properties > compatibility > change hidpisettings"
and set "High DPI scaling override" = system   (same as setting sun.java2d.dpiaware=false)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. in Windows "Display Settings" set  the option "Scale and Layout"  to 125% 
2. logout to assume the setting
3. force dpiware=false  in javaws.exe (setting "High DPI scaling override" = system)
3. launch the jnlp 
4. put some other window over the yellow area
5. click button "screen capture now"
6. observe that the captured image is "zoomed" and cutted

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
captured area exactly the same as the one layed over the yellow panel
ACTUAL -
captured area is not the same as the area layed over the yellow panel...its "zoomed" and is cuted 

---------- BEGIN SOURCE ----------
see JDK-8204508 : Robot ScreenCapture fails on HiDPI system
---------- END SOURCE ----------

FREQUENCY : always



Comments
Additional note from original submitter conveying that the issue continue to persist with 8u201 as well. "The initial bug JDK-8204508 was reported in 8u171 and 9 and was supposed to be fixed in java 8u192-b03 I tested JDK-8204508 with u192-b12 and u201 and the bug persists (image "zoomed" and because of that area is wrong)...so bug was not fixed in 8u192-b03 As reported in the initial the bug, the bug only happens if the app is not dpiaware (flag dpiaware must be false) Because the jnlp property "sun.java2d.dpiaware=false" is not working anymore ( since u192? ) you need to set "High DPI scaling override = system" in javaws.exe"
05-04-2019

Robot ScreenCapture captures a zoomed image, the issue is reported with 8u192 and is likely fixed in 8u201, courtesy JDK-8204508. Therefore, asking submitter to recheck with current version and respond back.
05-04-2019