new_extern_window — Create a virtual graphics window under Windows.
new_extern_window opens a new virtual window.
Note that this only works on Windows systems and drawing objects are not
Virtual means that a new window will not be created, but the window
whose window handle is given in the parameter
WINHWnd is used
to perform output of gray value data, regions, graphics as well as
to perform textual output.
All operators that allow the user to define graphical primitives through mouse interactions, like for example draw_rectangle1, do not work on external windows. The following operators can be used:
You may query current set values by calling operators like
get_shape. As some parameters are specified through the
hardware (Resolution/Colors), you may query current available
resources by calling operators like
WINHWnd is used to pass the window handle of
the window in which output should be done.
The origin of the coordinate system of the window resides in the
upper left corner (coordinates: (0,0)). The row index grows downward
Height-1), the column index grows to the right
You may use the value -1 for parameters
Height. This means, that the corresponding value is chosen
automatically. In particular, this is important if the aspect ratio
of the pixels is not 1.0 (see
set_system). If one of the
two parameters is set to -1, it will be chosen through the
size which results out of the aspect ratio of the pixels. If both
parameters are set to -1, they will be set to the current
The position and size of a window may change during runtime of a
program, e.g., through external influences (window manager). With
set_window_extents, you can change the size of
the (external) widow via the program. Note that
set_window_extents offers to change the position as well,
but you cannot change the position of an external window under
Opening a window causes the assignment of a default font. It is
used in connection with operators like
write_string and you
may change it by performing
set_font after calling
open_window. On the other hand, you have the possibility to
specify a default font by calling
set_system(::'default_font',<Fontname>:) before opening a
window (and all following windows; see also
You may set the color of graphics and font, which is used for output
set_insert specifies how
graphics is combined with the content of the image repeat memory.
Thereto you may achieve by calling, e.g.,
to eliminate the font after writing text twice at the same position.
The content of the window is not saved, if other windows overlap the window. This must be done in the program code that handles the window in the calling program.
For graphical output (
you may adjust the window by calling the operator
order to represent a logical clipping of the image format. In
particular this implies that only this part (appropriately scaled)
of images and regions is displayed. Before you close your window,
you have to close the HALCON-window.
Note that parameters as
Height are constrained through the
output device, i.e., the size of the Windows NT desktop.
Furthermore, be aware that all operators that allow the user to
define graphical primitives through mouse interactions, like for
example draw_rectangle1, do not work on external windows.
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.
Windows window handle of a previously created window.
WINHWnd != 0
Row coordinate of upper left corner.
Default value: 0
Row >= 0
Column coordinate of upper left corner.
Default value: 0
Column >= 0
Width of the window.
Default value: 512
Width > 0 || Width == -1
Height of the window.
Default value: 512
Height > 0 || Height == -1
// Needs to be embedded into an application framework, // see examples/cpp/mfc/MatchingExtWin.
If the values of the specified parameters are correct
new_extern_window returns 2 (H_MSG_TRUE). If necessary, an exception