autopy-legacy icon indicating copy to clipboard operation
autopy-legacy copied to clipboard

enhance compare_rect(..)

Open lecheel opened this issue 13 years ago • 0 comments

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: return 1 else: return 0

lecheel avatar Feb 13 '12 02:02 lecheel