public static Color GetPixelColor(int x, int y) { IntPtr hdc = NativeMethods.GetDC(IntPtr.Zero); uint pixel = NativeMethods.GetPixel(hdc, x, y); NativeMethods.ReleaseDC(IntPtr.Zero, hdc); return(Color.FromArgb((int)(pixel & 0x000000FF), (int)(pixel & 0x0000FF00) >> 8, (int)(pixel & 0x00FF0000) >> 16)); }