igogiko

Untitled

Mar 31st, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. import PIL.ImageGrab
  2. import win32api
  3.  
  4. def get_pixel_colour(i_x, i_y):
  5.     return PIL.ImageGrab.grab().load()[i_x, i_y]
  6.  
  7. def get_cursor_pos():
  8.     return win32api.GetCursorPos()
  9.  
  10. c = get_cursor_pos()
  11. print get_pixel_colour(c[0], c[1])
Advertisement
Add Comment
Please, Sign In to add comment