# HG changeset patch # User anthony # Date 1289320101 -10800 # Node ID 0eeadc73e6ef30bef6d27b6b2fd96b5aea924a9a # Parent 8db734b13eb62a015941da81eeb0e2f8876cb4e2 6989505: java.awt.Robot's getPixelColor treats not fully opaque Window as fully transparent. Summary: Use ::CreateDC() instead of ::GetDC() Reviewed-by: art, dcherepanov diff -r 8db734b13eb6 -r 0eeadc73e6ef jdk/src/windows/native/sun/windows/awt_Robot.cpp --- a/jdk/src/windows/native/sun/windows/awt_Robot.cpp Tue Nov 09 14:02:54 2010 +0300 +++ b/jdk/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; }