Skip to content

open_runtime_windowopen_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_windowT_open_runtime_windowπŸ”—

Short descriptionπŸ”—

open_runtime_windowopen_runtime_windowOpenRuntimeWindowOpenRuntimeWindowopen_runtime_windowT_open_runtime_window β€” Open a graphics window.

SignatureπŸ”—

open_runtime_window( dict GenParam, out window WindowHandle )open_runtime_window( : : GenParam : WindowHandle )void OpenRuntimeWindow( const HTuple& GenParam, HTuple* WindowHandle )static void HOperatorSet.OpenRuntimeWindow( HTuple genParam, out HTuple windowHandle )def open_runtime_window( gen_param: HHandle ) -> HHandle

Herror T_open_runtime_window( const Htuple GenParam, Htuple* WindowHandle )

void HWindow::OpenRuntimeWindow( const HDict& GenParam )

void HWindow.OpenRuntimeWindow( HDict genParam )

DescriptionπŸ”—

open_runtime_windowOpenRuntimeWindow 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_regionDispRegion, disp_imageDispImage, etc.) is directed to this window if the same logical window number WindowHandlewindowHandlewindow_handle is used.

In contrast to the operator open_windowOpenWindow, which also opens a new window, open_runtime_windowOpenRuntimeWindow takes the parameters used to create the window from the GenParamgenParamgen_param dictionary.

The GenParamgenParamgen_param dictionary accepts the following keys:

  • 'x'"x", '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, 00 is used by default.

  • 'width'"width", '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_systemSetSystem for the values 'width'"width" and 'height'"height").

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

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

    • '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 windows are not displayed on the screen. The keys 'x'"x", 'y'"y" and 'father'"father" have no effect. Output to these windows has no effect, and input (read_stringReadString, 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_colorQueryColor or get_string_extentsGetStringExtents.

    • '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", 'y'"y" and '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_rectangleCopyRectangle. Another use case is the fast processing of image sections during interactive manipulations. Text input and mouse interaction are not possible in 'buffer'"buffer" mode.

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

  • 'father'"father": This key specifies the father window to embed the new window in. If the control mode 'father'"father" is set via set_checkSetCheck, 'father'"father" must be the ID of a HALCON window, otherwise (texttt{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 00 or '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_extentsSetWindowExtents, or externally through the windowing system.

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

AttentionπŸ”—

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

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

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πŸ”—

GenParamgenParamgen_param (input_control) dict β†’ (handle)(handle)HTuple (HHandle)HDict, HTuple (IntPtr)HHandleHtuple (handle)

Parameter dictionary containing the window parameters to use.

Default: [][]

WindowHandlewindowHandlewindow_handle (output_control) window β†’ (handle)(handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (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_windowOpenRuntimeWindow returns 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible successors

set_content_update_callbackSetContentUpdateCallback

See also

open_windowOpenWindow

ModuleπŸ”—

Foundation