open_runtime_windowT_open_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_window (Operator)

Name

open_runtime_windowT_open_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_window — Open a graphics window.

Signature

open_runtime_window( : : GenParam : WindowHandle)

Herror T_open_runtime_window(const Htuple GenParam, Htuple* WindowHandle)

void OpenRuntimeWindow(const HTuple& GenParam, HTuple* WindowHandle)

void HWindow::OpenRuntimeWindow(const HDict& GenParam)

static void HOperatorSet.OpenRuntimeWindow(HTuple genParam, out HTuple windowHandle)

void HWindow.OpenRuntimeWindow(HDict genParam)

def open_runtime_window(gen_param: HHandle) -> HHandle

Description

open_runtime_windowopen_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_window opens a new window that can be used to output gray value data, regions, and graphics, as well as for text output. All output (disp_regiondisp_regionDispRegionDispRegiondisp_region, disp_imagedisp_imageDispImageDispImagedisp_image, etc.) is directed to this window if the same logical window number WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle is used.

In contrast to the operator open_windowopen_windowOpenWindowOpenWindowopen_window, which also opens a new window, open_runtime_windowopen_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_window takes the parameters used to create the window from the GenParamGenParamGenParamgenParamgen_param dictionary.

The GenParamGenParamGenParamgenParamgen_param dictionary accepts the following keys:

'x'"x""x""x""x", 'y'"y""y""y""y":

The x/y coordinates of the upper left corner of the window on the screen as an integer value. If these keys are not supplied in the dictionary, 0 is used by default.

'width'"width""width""width""width", 'height'"height""height""height""height":

The width/height of the window in pixels as an integer value. If these keys are not supplied in the dictionary, the maximum image width/height is used by default (further information about the currently used maximum image width and height can be found in the description of set_systemset_systemSetSystemSetSystemset_system for the values 'width'"width""width""width""width" and 'height'"height""height""height""height").

You may use the value -1 for the keys 'width'"width""width""width""width" and 'height'"height""height""height""height". This tells open_runtime_windowopen_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_window to determine the value to use automatically. In particular this is of importance, if the proportion of pixels is not 1.0 (see set_systemset_systemSetSystemSetSystemset_system). If only one of the two parameters is set to -1, the value is determined by the size resulting from the pixel aspect ratio. If both parameters are set to -1, width and height will be set to the current maximum image width and height.

'mode'"mode""mode""mode""mode":

The mode of the window to open. It may have the following values:

'visible'"visible""visible""visible""visible":

This is the standard mode for graphics windows. The window is created according to the specified parameters, and all input and output operations are possible.

'invisible'"invisible""invisible""invisible""invisible":

Invisible windows are not displayed on the screen. The keys 'x'"x""x""x""x", 'y'"y""y""y""y" and 'father'"father""father""father""father" have no effect. Output to these windows has no effect, and input (read_stringread_stringReadStringReadStringread_string, mouse, etc.) is not possible. These windows are used to query display parameters for an output device without opening a (visible) window. Typical queries are, e.g., query_colorquery_colorQueryColorQueryColorquery_color or get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsget_string_extents.

'buffer'"buffer""buffer""buffer""buffer":

These are also invisible windows. The output of images, regions and graphics is not visible on the screen but is buffered in memory. The keys 'x'"x""x""x""x", 'y'"y""y""y""y" and 'father'"father""father""father""father" have no effect. Buffer windows are used, for example, to prepare output (in the background) and then copy it into a visible window using copy_rectanglecopy_rectangleCopyRectangleCopyRectanglecopy_rectangle. Another use case is the fast processing of image sections during interactive manipulations. Text input and mouse interaction are not possible in 'buffer'"buffer""buffer""buffer""buffer" mode.

If this key is not present in the dictionary, the mode 'visible'"visible""visible""visible""visible" is used by default.

'father'"father""father""father""father":

This key specifies the father window to embed the new window in. If the control mode 'father'"father""father""father""father" is set via set_checkset_checkSetCheckSetCheckset_check, 'father'"father""father""father""father" must be the ID of a HALCON window, otherwise (set_check(::'~father':) ) it can also be the ID of an operating system window.

If this key is not present in the dictionary, or the values 0 or 'root'"root""root""root""root" are used, the father window is the desktop.

This parameter is ignored on platforms other than Windows or Linux.

Unknown keys are silently ignored.

Position and size of a window may change during runtime of a program. This can happen by calling set_window_extentsset_window_extentsSetWindowExtentsSetWindowExtentsset_window_extents, or externally through the windowing system.

Applications using HALCON can override the behavior of open_runtime_windowopen_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_window for windows with a 'father'"father""father""father""father" of 0 and a 'mode'"mode""mode""mode""mode" of 'visible'"visible""visible""visible""visible". In this case the operator may take additional keys in the GenParamGenParamGenParamgenParamgen_param dictionary, or interpret the documented keys differently.

Attention

Note that the keys 'x'"x""x""x""x", 'y'"y""y""y""y", 'width'"width""width""width""width" and 'height'"height""height""height""height" are limited by the output device. If you specify a father window ('father'"father""father""father""father" < > 'root'), the coordinates are relative to this window.

Execution Information

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

GenParamGenParamGenParamgenParamgen_param (input_control)  dict → HDict, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Parameter dictionary containing the window parameters to use.

Default: []

WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (output_control)  window → HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

Example (HDevelop)

Params := dict{}
Params.width  := 400
Params.height := -1
Params.mode   := 'visible'
open_runtime_window (Params, WindowHandle)
read_image (Image, 'fabrik')
disp_image(Image,WindowHandle)
write_string(WindowHandle,'File, fabrik')
new_line(WindowHandle)
get_mbutton(WindowHandle,_,_,_)
set_lut(WindowHandle,'temperature')
set_color(WindowHandle,'blue')
write_string(WindowHandle,'temperature')
new_line(WindowHandle)
write_string(WindowHandle,'Draw Rectangle')
new_line(WindowHandle)
draw_rectangle1(WindowHandle,Row1,Column1,Row2,Column2)
set_part(WindowHandle,Row1,Column1,Row2,Column2)
disp_image(Image,WindowHandle)
new_line(WindowHandle)

Result

If the parameter values are correct, open_runtime_windowopen_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_window returns 2 ( H_MSG_TRUE) . Otherwise, an exception is raised.

Possible Successors

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallbackset_content_update_callback

See also

open_windowopen_windowOpenWindowOpenWindowopen_window

Module

Foundation