Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagesearcharea bug #30

Open
frandegrandis opened this issue Dec 1, 2020 · 1 comment
Open

imagesearcharea bug #30

frandegrandis opened this issue Dec 1, 2020 · 1 comment

Comments

@frandegrandis
Copy link

Im using imagesearcharea to just get the game screen using:

wHandler = win32gui.FindWindow(None,'Yu-Gi-Oh! DUEL LINKS')
windowRect = win32gui.GetWindowRect(wHandler)

when i use:

pos = imageRecognition.imagesearcharea('OK.jpg',windowRect[0],windowRect[1],windowRect[2],windowRect[3],0.9)
    if pos != [-1,-1]:
        imageRecognition.click_image('OK.jpg',pos,'left',0)

It returns [-1,-1], but if i usea:

pos = imageRecognition.imagesearcharea('OK.jpg',0,0,windowRect[2],windowRect[3],0.9)
    if pos != [-1,-1]:
        imageRecognition.click_image('OK.jpg',pos,'left',0)

it works fine. There is something im doing wrong?

@drov0
Copy link
Owner

drov0 commented Dec 5, 2020

check the coordinates that getWindowRect returns, it may be that it's not in the right order.

If that doesn't work, I suggest just moving the window to 0,0 so you're always in the right spot

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

No branches or pull requests

2 participants