FindImagePos NumFound=-1

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
voodoogodman
Newbie
Posts: 4
Joined: Wed Jan 11, 2012 7:07 am

FindImagePos NumFound=-1

Post by voodoogodman » Sun Jul 22, 2012 3:49 pm

What does a negative value for numfound mean?

I've run WaitScreenImage first and the image was located (WSI_RESULT=1)

Thank You

Code: Select all

GetScreenRes>x,y
ScreenCapture>0,0,x,y,C:\temp1.bmp
Let>WSI_TIMEOUT=20
WaitScreenImage>C:\Page_1_Begin_ Button.bmp,0
FindImagePos>C:\Page_1_Begin_Button.bmp,C:\temp1.bmp,0,1,XArr,YArr,NumFound


I'm an idiot. Found my mistake. My needle image was .jpg Oops.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jul 23, 2012 9:35 am

This means that either the haystack or needle image files were not found, or if a window name was specified the window wasn't found, or the needle is larger (in one dimension or both) than the haystack.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Jul 23, 2012 5:36 pm

mtettmar wrote:This means that either the haystack or needle image files were not found, or if a window name was specified the window wasn't found, or the needle is larger (in one dimension or both) than the haystack.
Thanks Marcus, it good to know that after using the FindImagePos> command, a negative value for numfound means one of those things... however in the Help File, all it says is:
Help File Topic for FindImagePos wrote:NumFound returns the number of matches found.
There is no mention that it could actually return -1 which signals an error and the conditions that could have caused the error.

Please consider adding this info to that Help File topic as the Help File is the first place a user should turn to when having issues with a command... and not very many users read these forums daily... though I highly recommend it!

Thanks and take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts