Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

enhance compare_rect(..) #31

Open
lecheel opened this issue Feb 13, 2012 · 0 comments
Open

enhance compare_rect(..) #31

lecheel opened this issue Feb 13, 2012 · 0 comments
Labels

Comments

@lecheel
Copy link

lecheel commented Feb 13, 2012

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants