JDK-6596234 : Robot's screen captured image is not accelerated
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-08-23
  • Updated: 2008-07-16
  • Resolved: 2007-10-23
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 6 JDK 7
6u10 b06Fixed 7Fixed
Related Reports
Relates :  
Relates :  
Description
I am capturing the desktop using Robot.createScreenCapture() and performing some transformations such as rotation and scaling on that image. I am using a BufferStrategy to render the transformed image onto a canvas. The performance is noticeably slow when using the image returned by Robot as is but when I copy the screenshot into another buffered image, the app flies. 

We should see if we can accelerate the Robot returned image, by some means.

Run the attached test to see the performance of a screen-captured image. I have currently commented out the code that copies the Robot's image into another buffered image. You can uncomment the same and see the difference.

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/6u5/6615272.0
10-10-2007

EVALUATION Since the image returned by Robot.createScreenCapture() is created using DataBuffer, it becomes unacceleratable. We could restore the 'acceleratable' status before returning it to the user.
23-08-2007

WORK AROUND bimg = r.createScreenCapture(new Rectangle(0, 0, screenSize.width, screenSize.height)); BufferedImage bi = new BufferedImage(bimg.getWidth(), bimg.getHeight(), bimg.getType()); Graphics g = bi.getGraphics(); g.drawImage(bimg, 0, 0, null); bimg = bi;
23-08-2007