Is there some new .NET-approved way to get the color of a pixel in a window (a window external to my program). In VB6 I would do something like this using API functions:
GetCursorPos p
hwnd = WindowFromPoint(p.x, p.y)
deskhdc = GetDC(hwnd)
rgbVal = GetPixel(deskhdc, p.x, p.y)
retval = ReleaseDC(hwnd, deskhdc)
Is there a better way to do this in .NET or is this still the way to go?
GetCursorPos p
hwnd = WindowFromPoint(p.x, p.y)
deskhdc = GetDC(hwnd)
rgbVal = GetPixel(deskhdc, p.x, p.y)
retval = ReleaseDC(hwnd, deskhdc)
Is there a better way to do this in .NET or is this still the way to go?