msanders/autopy — Issue #31: enhance compare_rect(..)
Author: lecheel
Created: 2012-02-13 02:32:22+00:00
State: open

from PIL import Image
possible add following api for rect compare using native autopy instead PIL

def compare_rect((ax,ay),bmp_name):
im=Image.open(bmp_name)
rect = ((ax-1,ay-1),(im.size[0]+2,im.size[1]+2))
tst = bitmap.Bitmap.open(bmp_name)
scr = bitmap.capture_screen(rect)
pos = scr.find_bitmap(tst)
if pos:
# print "Match %s Founded!!!" % bmp_name
return 1
else:
return 0