From b8107f137d4e4b65ad5bb202b1adaa76a9dd300d Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Tue, 9 Nov 2010 19:28:21 +0300 Subject: [PATCH] 6989505: java.awt.Robot's getPixelColor treats not fully opaque Window as fully transparent Use ::CreateDC() instead of ::GetDC() Reviewed-by: art, dcherepanov --- jdk/src/windows/native/sun/windows/awt_Robot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/windows/native/sun/windows/awt_Robot.cpp b/jdk/src/windows/native/sun/windows/awt_Robot.cpp index bef6f13ede5..bab9f61b8b7 100644 --- a/jdk/src/windows/native/sun/windows/awt_Robot.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Robot.cpp @@ -194,9 +194,9 @@ inline jint AwtRobot::WinToJavaPixel(USHORT r, USHORT g, USHORT b) 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; }