Wait for Pixels

<< Click to Display Table of Contents >>

Navigation:  Actions > Screenshot >

Wait for Pixels

The action waits for the change of pixels color on a screen or in an appointed window. This is a standard way to identify finishing some operation in a system: a picture or an inscription will change. Or some area of a window (or screen) will change its color.

The action pauses the executing of a task and waits for changing of pixels color on a screen or in a selected window. The action will continue to implement the task when the condition of correspondence of colors of the selected pixels is fulfilled.

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)

Thereby, you can specify the exact enough condition of changes on a screen.

If the action has not waited for implementation of the condition for a predetermined time, the action generates the error "Timeout error".

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

WaitForPixels1 WaitForPixels2


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.



What to expect

Wait for pixels to appear (default) – the action will wait for the appearance of pixels listed below. If the required pixels are already present and the condition is met, then no waiting occurs, and the task execution proceeds to the next step.

Wait for pixels to disappear – the action will wait for the disappearance of the listed pixels. If the required pixels are already absent, then the waiting is not performed.


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.



There are two options:

Timeout - It is waiting time in seconds. On default, it is 60 seconds.

If the timeout is over you can specify an action:

oRaise Timeout error - this is default option

oSet True or False to variable - in this case the task will continue work without error.

Infinity - This is not limited waiting time. Pay attention, if you specify an illegal condition of the checking of pixels, the task can "hang down" and it can be finished by means of the function "Kill task" only.



note Related Topics

Window Snapshot

Window Pixel


Screen Pixel

Color Compliance

Wait for Pixels

Find Pixel on Image

Check pixels