Exists on screen action Version 9 (Python)
Action group: Vision
Description
This action is intended to check (for a specified time) the existence of images similar to the sample on the screen.
Action icon
Action parameters
Input parameters
Sample image - The path to the sample image file. Supported image formats: (jpeg, jpg, bmp, png, tif, tiff).
Similarity rate - The similarity coefficient between the sample and the searched area. The maximum value is "1".
Timeout, ms - Time during which the specified object will be expected to appear. Timeout is set in milliseconds. Type - Robin.Numeric.
Output parameters
Result - Returns "true" if the template image is found on the screen otherwise "false".
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Sample image | Path to sample image file. Supported image formats: (jpeg, jpg, bmp, png, tif, tiff) | Robin.Image | C:\doc\img.png | Yes |
Similarity rate | Coefficient of similarity between the sample image and the target area. The maximum value is «1». | Robin.Numeric | Yes | |
Timeout (ms) | The time during which the appearance of the specified object will be expected. Time-out is set in milliseconds | Robin.Numeric | No | |
Results | ||||
Result | Returns «true» if the sample image is found on the screen otherwise «false» | Robin.Boolean | true |
Special conditions of use
The search image resolution and the screen resolution must match for the action to work correctly. For this purpose it is recommended to make a screenshot of the image.
If the result is "false" and the object is present on the screen, it means that it is necessary to specify the similarity rate with the search image.
The most effective way to use files with the extension ".png"
Example of use
Task
It is necessary to determine whether an image exists on the screen and display a dialog box with a message: image found on the screen or image not found on the screen.
Solution
Use the actions "Exists on screen action", "If", "Show message".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the parameters of the "Exists on screen action" action.
- Set the "If" action parameter.
- Customize "Show message" action parameters for true and false branches.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully.
The image is found on the screen. The corresponding dialog box is displayed.