< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m

Print this page

        

@@ -274,23 +274,24 @@
  * Signature: (IIIII[I)V
  */
 JNIEXPORT void JNICALL
 Java_sun_lwawt_macosx_CRobot_nativeGetScreenPixels
 (JNIEnv *env, jobject peer,
- jint x, jint y, jint width, jint height, jintArray pixels)
+ jint x, jint y, jint width, jint height, jdouble scale, jintArray pixels)
 {
     JNF_COCOA_ENTER(env);
 
     jint picX = x;
     jint picY = y;
     jint picWidth = width;
     jint picHeight = height;
 
-    CGRect screenRect = CGRectMake(picX, picY, picWidth, picHeight);
+    CGRect screenRect = CGRectMake(picX / scale, picY / scale,
+                                picWidth / scale, picHeight / scale);
     CGImageRef screenPixelsImage = CGWindowListCreateImage(screenRect,
                                         kCGWindowListOptionOnScreenOnly,
-                                        kCGNullWindowID, kCGWindowImageDefault);
+                                        kCGNullWindowID, kCGWindowImageBestResolution);
 
     if (screenPixelsImage == NULL) {
         return;
     }
 
< prev index next >