changeset 3028:4c5aa2af3540

6989505: java.awt.Robot's getPixelColor treats not fully opaque Window as fully transparent. Summary: Use ::CreateDC() instead of ::GetDC() Reviewed-by: art, dcherepanov
author anthony
date Tue, 09 Nov 2010 19:28:21 +0300
parents 65bd45308475
children 8e4806e40a25
files src/windows/native/sun/windows/awt_Robot.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_Robot.cpp	Tue Nov 09 14:02:54 2010 +0300
+++ b/src/windows/native/sun/windows/awt_Robot.cpp	Tue Nov 09 19:28:21 2010 +0300
@@ -194,9 +194,9 @@
 
 jint AwtRobot::GetRGBPixel( jint x, jint y)
 {
-    HDC hdc = GetDC(NULL);
+    HDC hdc = ::CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
     COLORREF ref = ::GetPixel( hdc, x, y );
-    ReleaseDC(NULL,hdc);
+    ::DeleteDC(hdc);
     jint value = WinToJavaPixel(GetRValue(ref), GetGValue(ref), GetBValue(ref));
     return value;
 }