Skip to content

attach_background_to_windowAttachBackgroundToWindowAttachBackgroundToWindowattach_background_to_windowT_attach_background_to_window🔗

Short description🔗

attach_background_to_windowAttachBackgroundToWindowAttachBackgroundToWindowattach_background_to_windowT_attach_background_to_window — Attach a background image to a HALCON window.

Signature🔗

attach_background_to_window( image Image, window WindowHandle )void AttachBackgroundToWindow( const HObject& Image, const HTuple& WindowHandle )static void HOperatorSet.AttachBackgroundToWindow( HObject image, HTuple windowHandle )def attach_background_to_window( image: HObject, window_handle: HHandle ) -> None

Herror T_attach_background_to_window( const Hobject Image, const Htuple WindowHandle )

void HWindow::AttachBackgroundToWindow( const HImage& Image ) const

static void HDrawingObject::AttachBackgroundToWindow( const HImage& Image, const HWindow& WindowHandle )

void HWindow.AttachBackgroundToWindow( HImage image )

static void HDrawingObject.AttachBackgroundToWindow( HImage image, HWindow windowHandle )

Description🔗

This operator attaches the background image passed in Imageimageimage to a HALCON window defined in WindowHandlewindowHandlewindow_handle. The input image is copied. Thus it can be freed safely.

The background image is instantly displayed in the HALCON window when calling attach_background_to_windowAttachBackgroundToWindow. All HALCON objects that were previously displayed in the window will still be displayed when calling this operator. Thus the previous window content will not be overwritten.

The window contents are displayed in the following order: first the background image, then HALCON objects, and finally the drawing objects. Thus, the drawing object is displayed always on top. Note that the window will be redrawn for each user interaction within the window and each call of set_partSetPart. HALCON objects can be deleted from the window with clear_windowClearWindow.

The background image can be removed from the window with the operator detach_background_from_windowDetachBackgroundFromWindow.

Attention🔗

Note that using any synchronous operator which actively probe the event queue, e.g., get_mbuttonGetMbutton or read_charReadChar, will conflict with the interaction with the drawing objects. In case the state of the cursor has to be read, please refer to the documentation of your framework of choice for an appropriate, non-invasive alternative.

Furthermore, the event based functionality should not be used together with the former blocking operators draw_rectangle1DrawRectangle1, draw_rectangle2DrawRectangle2, draw_regionDrawRegion, draw_xldDrawXld or draw_circleDrawCircle. They conflict with the event based functionality, since they actively fetch all events sent to the HALCON 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.

Parameters🔗

Imageimageimage (input_object) singlechannelimage → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)

Background image.

WindowHandlewindowHandlewindow_handle (input_control) window → (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

Result🔗

If the window exists and the specified parameters are correct attach_background_to_windowAttachBackgroundToWindow returns 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

open_windowOpenWindow

Possible successors

detach_background_from_windowDetachBackgroundFromWindow

Module🔗

Foundation