dev_open_window ( : : Row, Column, Width, Height, Background : WindowHandle )

Open a graphics window.

dev_open_window opens a new graphics window, which can be used to perform output of gray value data, regions, and graphics as well as to perform textual output. This new window automatically becomes active, which means that all output (dev_display and automatical display of operator results) is redirected to this window. This is shown by the green dot in the Active button.

In the case of the standard display operators (like disp_image, disp_region, disp_line, etc.) instead of dev_display the logical window number WindowHandle has to be used.

The background of the created window is set to the color specified in Background.

Pressing the Clear button clears the graphics window contents and the history of the window. This can also be achived by using the operator dev_clear_window. You close a graphics window using the Close button of the window frame or by calling dev_close_window.

The the origin of the graphics window is the upper left corner with the coordinates (0,0). The x values (column) increase from left to right, the y values increase from top to bottom. Normally, the coordinate system of the graphics window corresponds to the the most recently displayed image, which is automatically zoomed so that every pixel of the image is visible. The coordinate system can be changed interactively using the menu Visualization->Set Parameters->Zoom or with the operator dev_set_part. Every time an image with a different size is displayed, the coordinate system will be adapted automatically.

Each window has a history which contains all

objects and
display parameters
which have been displayed or changed since the most recent clear action or display of a full image. This history is used for redrawing the contents of the window. Other output like text or general graphics like disp_line or disp_circle or iconic data that is displayed using HALCON operators like disp_image or disp_region are notnotVisualization in the menu bar. Here you can set the appropriate parameters by clicking the desired item. Parameters which you have set in this way are used for all windows (in contrast to standard windows opened with open_window). The effects of the new parameters will be applied direcly to the last object of the window history and alter its parameters only.


Attention

Never use close_window to close an HDevelop graphics window. The operator dev_close_window has to be used instead.

If dev_open_window should be used for exported Code (C++), please note the description of open_window due to the different semantics in C++.


Parameters

Row (input_control)
rectangle.origin.y -> integer
Row index of upper left corner.
Default value: 0
Typical range of values: 0 <= Row
Minimum increment: 1
Recommended increment: 1
Restriction: Row >= 0

Column (input_control)
rectangle.origin.x -> integer
Column index of upper left corner.
Default value: 0
Typical range of values: 0 <= Column
Minimum increment: 1
Recommended increment: 1
Restriction: Column >= 0

Width (input_control)
rectangle.extent.x -> integer
Width of the window.
Default value: 256
Typical range of values: 0 <= Width
Minimum increment: 1
Recommended increment: 1
Restriction: (Width > 0) || (Width == -1)

Height (input_control)
rectangle.extent.y -> integer
Height of the window.
Default value: 256
Typical range of values: 0 <= Height
Minimum increment: 1
Recommended increment: 1
Restriction: (Height > 0) || (Height == -1)

Background (input_control)
integer -> integer / string
Color of the background of the new window.
Default value: ''black''

WindowHandle (output_control)
window -> integer
Window identifier.


Example
dev_close_window ()
read_image (For5, 'for5')
get_image_pointer1 (For5, Pointer, Type, Width, Height)
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (For5)
dev_set_lut ('rainbow')
dev_display (For5)
stop ()
dev_set_lut ('default')
dev_display (For5)
stop ()
dev_set_part (100, 100, 300, 300)
dev_display (For5)

Result

If the values of the specified parameters are correct dev_open_window returns 2 (H_MSG_TRUE). If necessary an exception handling is raised.


Parallelization Information

dev_open_window is local and processed completely exclusively without parallelization.


Possible Successors

dev_display, dev_set_lut, dev_set_color, dev_set_draw, dev_set_part


Alternatives

open_window


See also

query_color


Module

System



Copyright © 1996-2005 MVTec Software GmbH