6989505: java.awt.Robot's getPixelColor treats not fully opaque Window as fully transparent
Use ::CreateDC() instead of ::GetDC() Reviewed-by: art, dcherepanov
This commit is contained in:
parent
4c592b0ab5
commit
b8107f137d
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user