Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import ImageGrab, ImageOps
- import Image
- import sys, os
- #import win32api, win32con
- import time
- def getWindowPos():
- found = 0
- im = ImageGrab.grab()
- winLeft = im.size[0] / 2
- print winLeft
- winTop = im.size[1] / 2
- print winTop
- while found == 0:
- winLeft -= 1
- if im.getpixel((winLeft, winTop)) == (8, 85, 221):
- found = 1
- found = 0
- while found == 0:
- winTop -= 1
- if im.getpixel((winLeft, winTop)) == (1, 68, 208):
- found = 1
- return (winLeft, winTop)
- def main():
- print getWindowPos()
Add Comment
Please, Sign In to add comment