Check pixels

<< Click to Display Table of Contents >>

Navigation:  Actions > Screenshot >

Check pixels

This action, in terms of parameters, is similar to the "Wait for Pixels" action, but here it simply checks for the presence of the listed pixels. The result of the action is a logical value True/False. The result is assigned to the RoboTask variable.

You can specify a set of pixels (one or several) in this action. It is necessary to specify the required color and the tolerance  of color comparing for each pixel.

You can specify the condition of color coincidence for a set of pixels:

Match ALL of the following pixels (AND)

Match ANY of the following pixels (OR)

 

If the required window has not been found to the moment of a start of a task, the action generates the error "Window is not found"

 

Source tab

CheckPixels1 CheckPixels2

 

When you determine parameters of an action, at first you need to specify the source of a picture:

Window - This is a separate window. All coordinates of pixels will be determined concerning the upper left corner of this window. If you have selected the window as a source, you need to specify the window parameters.

Entire screen - This is a screen with all visible windows.

The window parameters are similar to the parameters in the actions Window Snapshot, Window Command, Window Size and Position, Window Elements loop.

 

Window Parameters Mode

Use Window parameters - Use the Window Caption and the Window Class to look for the necessary window.

Use Window Handle - This is a search for a window by a handle. The handle can be got in the loop Window Loop, from the trigger Wait for Window or some other way.

Use current window - This is a current window in a moment of the executing of the action. This mode does not require any additional parameters.

 

Use alternate method of Snapshot

Generally, getting a window image works correctly. But, unfortunately, not always. Some applications do not allow you to take a picture directly from the window. For example, Google Chrome or applications with the Metro user interface. To get the image, you must use an alternative method in this case.

An alternative method is that the application cuts a window image from a desktop snapshot.

But please note that this method cannot get the correct image if the desired window (or part of the window) is covered by another window or goes beyond the desktop.

You need to ensure the visibility of the window before taking a snapshot.

 

Use Window parameters

Window Caption.

If you want to search for a window by means of its caption, switch on this checkbox and input the expected window caption. You can input only part of the caption. In this case the action will check availability of the input part in the window caption.

Caption Must Match Exactly

If you need the exact coincidence of a window caption, switch on this checkbox.

 

Window Class.

If you want to search the window by a window class, switch on this checkbox and input the expected name of the window class. You can input only part of the name. In this case the action will check availability of the input line in the name of the window class.

Class Name Must Match Exactly.

If you need the exact coincidence of a window class, switch on this checkbox. Usually it is worthwhile to search by the whole class name, because a window class is permanent and does not change its value during the "life" of the window, unlike a caption.

 

Select Window on the Screen.

When pressing this button, you turn on the mechanism of selection a window on the screen. The window, which the mouse pointer  points on, highlights with a red frame. Meanwhile, you can use the mouse to perform some actions. To select the necessary window, press Ctrl. To cancel - press Esc. When selecting a window, the fields Window Caption and Window Class are filled in automatically.

 

Window Handle.

Input the expression containing a window handle. This parameter is used for the mode Use Window Handle. A window handle is just a number, identifier of a window in a current session of system work.

 

Pixels tab

You need to specify the pixel set for checking on this tab.

 

CheckPixels3

 

List of pixels

You can edit a list using the buttons Add, Edit and Remove.

By means of an edit window you can change pixel parameters both manually and by means of interactive instruments.

Pixel parameters:

X, Y - It is coordinates of a pixel from the left corner. If a source of a picture is a window, coordinates are determined from the upper left corner of the screen window.

Pattern color - This is a pattern of the color with which the action will compare the color of a pixel. Color is just a number. For comfort it is written in hexadecimal.

For example, $0066FF00 or $66FF00.

In hexadecimal you can write color using 6 symbols (as RGB): the first couple (younger) is red, the second couple is green, the third couple (elder) is blue color.

Tolerance - This is an accuracy of color coincidence. The error can be changed from 0 to 255 (in hex from 00 to FF). When it is 0, it is exact color coincidence. When it is 255, it is a coincidence with any color.

Tolerance is an acceptable difference between two colors for any component RGB (Red – Green - Blue). Every component of the color can be changed from 0 to 255 (from 00 to FF in hexadecimal).

On default, the tolerance is 16.

 

Save result (TRUE or FALSE) to variable

Enter the name of the variable in which to save the logical value.

 

 

note Related Topics

Window Snapshot

Window Pixel

Screenshot

Screen Pixel

Color Compliance

Wait for Pixels

Find Pixel on Image