Ejemplo n.º 1
0
 def getPixelOnDesktop(self, x, y):
     hwnd = win32gui.GetDesktopWindow()
     dc = win32gui.GetWindowDC(self.desktopHwnd)
     long_color = win32gui.GetPixel(dc, x, y)
     color = int(long_color)
     color = (color & 0xff), ((color >> 8) & 0xff), ((color >> 16) & 0xff)
     return libs.rgb_to_hex(color)
Ejemplo n.º 2
0
 def getPixelWithDC(self, dc, x, y):
     # GetPixel include title bar
     x += self.dx
     y += self.dy
     long_color = win32gui.GetPixel(dc, x, y)
     color = int(long_color)
     color = (color & 0xff), ((color >> 8) & 0xff), ((color >> 16) & 0xff)
     return libs.rgb_to_hex(color)