Jump to content

Help with ImageSearch coordinates

Go to solution Solved by Kidney,

Recommended Posts

First off, I'm brand new to AutoIT and this forum.  Love the program so far and look forward to learning how to use it more.  I tried searching for the solution to my problem but I couldn't find one, so hoping someone can help.

I'm trying to use ImageSearch.  It seems to be working fine except for one part which might be by design so that's what I'm trying to find out.

I can't get _ImageSearchArea to use window coordinates.  It only seems to work with the entire screen coordinates.

ImageSearch works fine.

_ImageSearchArea using screen coordinates works fine

_ImageSearchArea using window coordinates still searches the entire screen.

I tried using PixelCoordMode, 0 and MouseCoordMode, 0 but that didn't help.


Anyone else have this issue?  Is this how it should be behaving?

Link to comment
Share on other sites

  • Solution

$aResult = WinGetPos("Window Title")
;$aResult[0] = Left
;$aResult[1] = Top
;$aResult[2] = Width
;$aResult[3] = Height
_ImageSearchArea("TestImage.png", 0, $ReturnedX, $ReturnedY, ($aResult[0] + $aResult[2]), ($aResult[1] + $aResult[3]), $aResult[0], $aResult[1], 100)
;Make sure that the "right" and "bottom" parameters are larger than the "x" and "y".
;Also check to make sure you are adding the Top and Height together as well as Left and Width from the WinGetPos
MouseMove($ReturnedX, $ReturnedY, 0)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...