Find an Image and compare

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
nehulagr
Newbie
Posts: 4
Joined: Mon Aug 20, 2012 5:03 pm

Find an Image and compare

Post by nehulagr » Tue Aug 21, 2012 8:56 pm

Hello, i doing good with scripting. I just got stuck somewhere.

there i want to check an image if that similar image(a portion of screen) is present somewhere on the window then i want to perform a task.

And i want to even wait for that screen to be come up with that particular image(a portion of screen).

Please Help me.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Thu Aug 23, 2012 2:55 pm

I think WaitScreenImage is what you are looking for.

Taken from the help file
WaitScreenImage>BitmapFile[,Color_Tolerance]

Not supported in Macro Scheduler Lite.

Waits until the image in BitmapFile is found on the screen.

Returns the number of occurrences found on the screen in the WSI_RESULT variable.

Optionally, a Color tolerance value can be specified. The default is 0 (no tolerance). If color_tolerance is zero the pixel colors must match exactly. color_tolerance can be set to a value between 0 and 255. If larger than zero the red, green and blue values of the pixels in bitmap_to_scan are checked to see if they are within the tolerance specified (color value + or - color_tolerance). Smaller values match less and larger values match more.

The system variable WSI_TIMEOUT can be used to set the number of seconds after which this command should timeout. If set to zero (the default) the timeout will not occur and the command will continue indefinitely. If WSI_TIMEOUT is used, WSI_TIMEDOUT will indicate whether or not the command ended successfully. If it timed out WSI_TIMEDOUT will be set to TRUE otherwise, if the image was found within the time out period it will be set to FALSE.


Abbreviation: WSI

See also: CompareBitmaps, FindImagePos, ScreenCapture, GetScreenRes

Example

WaitScreenImage>d:\today_button.bmp
MessageModal>FoundIt

nehulagr
Newbie
Posts: 4
Joined: Mon Aug 20, 2012 5:03 pm

Working!!

Post by nehulagr » Thu Aug 23, 2012 7:39 pm

Thanks! Its working. :)

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