open_runtime_window — Open a graphics window.
open_runtime_window( : : GenParam : WindowHandle)
open_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_region, disp_image, etc.) is directed to this
window if the same logical window number WindowHandle is used.
In contrast to the operator open_window, which also opens a new
window, open_runtime_window takes the parameters used to create the
window from the GenParam dictionary.
The GenParam dictionary accepts the following keys:
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.
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_system for the values 'width' and 'height').
You may use the value -1 for the keys 'width' and
'height'. This tells open_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_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.
The mode of the window to open. It may have the following values:
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 windows are not displayed on the screen. The keys
'x', 'y' and 'father' have no effect.
Output to these windows has no effect, and input
(read_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_color or get_string_extents.
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', 'y' and '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_rectangle.
Another use case is the fast processing of image sections during
interactive manipulations.
Text input and mouse interaction are not possible in
'buffer' mode.
If this key is not present in the dictionary, the mode 'visible' is used by default.
This key specifies the father window to embed the new window in. If the
control mode 'father' is set via set_check,
'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' 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_extents, or externally through the
windowing system.
Applications using HALCON can override the behavior of
open_runtime_window for windows with a 'father' of
0 and a 'mode' of 'visible'. In this case the
operator may take additional keys in the GenParam dictionary, or
interpret the documented keys differently.
Note that the keys 'x', 'y', 'width' and 'height' are limited by the output device. If you specify a father window ('father' < > 'root'), the coordinates are relative to this window.
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.
GenParam (input_control) dict → (handle)
Parameter dictionary containing the window parameters to use.
Default: []
WindowHandle (output_control) window → (handle)
Window handle.
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)
If the parameter values are correct, open_runtime_window returns
2 (
H_MSG_TRUE)
. Otherwise, an exception is raised.
Foundation