Text Search Based on Image


Searches a text on the screen, and then carries out a mouse action. Unlike the action "Image search", you need to specify a string and the font parameters rather than an image file. This action is generally used to locate the position of a ever-change text. For example, you may have a task that clicks an item in the list-box in a Java application. You need to get the coordinates of the item on the screen, then use the action "Click Mouse Button" to click it. If you use the action "Image Search" to locate the item, an image is required and obviously it can not represent a dynamic (ever-changing) text.

The routine converts the text into an image (monochrome) based on the font parameters, and then searches for the image in the specified area on the screen/window. If a match is present, the X and Y coordinates could be retrieved for the subsequent actions as well. If the font is not same as the font of the text on the screen, the searching will fail.

Parameters

  • Text Specifies the text to be searched for.

  • Tolerance Specifies the value (0 - 10) for how much the image searched for can differ from the specified image.

  • Threshold method Specifies the method of converting the color image to the monochrome.

  • Use Windows system font parameters Specifies whether to use the system parameters for the font.

  • Font name Specifies the font name.

  • Font size Specifies the font size.

  • Font quality Specifies the font quality.

  • Spacing Specifies the character spacing.

  • Font style Specifies the font style.

  • Font color Specifies the color style of the text on the image, it can be one of the following:

    • Specify text and background color
    • Light background with dark text
    • Dark background with light text
    • Auto
  • Text color Specifies the text color.
  • Back color Specifies the background color.
  • Search in a specified area Specifies the area to limit where to search.

Notes:

  • About the options after searching, please refer to "After Searching".
  • If the text does not locate in the area, the coordinates value -1, -1 will be returned, and an error will throw.
  • You may use the action "Image search" to retrieve the position of an icon, button, or other shape.