ClassesClassesClassesClasses | | | | Operators

set_window_dcset_window_dcSetWindowDcset_window_dcSetWindowDcSetWindowDc (Operator)

Name

set_window_dcset_window_dcSetWindowDcset_window_dcSetWindowDcSetWindowDc — Set the device context of a virtual graphics window (Windows NT).

Signature

set_window_dc( : : WindowHandle, WINHDC : )

Herror set_window_dc(const Hlong WindowHandle, const Hlong WINHDC)

Herror T_set_window_dc(const Htuple WindowHandle, const Htuple WINHDC)

Herror set_window_dc(const HTuple& WindowHandle, const HTuple& WINHDC)

void HWindow::SetWindowDc(const HTuple& WINHDC) const

void SetWindowDc(const HTuple& WindowHandle, const HTuple& WINHDC)

void HWindow::SetWindowDc(void* WINHDC) const

void HOperatorSetX.SetWindowDc(
[in] VARIANT WindowHandle, [in] VARIANT WINHDC)

void HWindowX.SetWindowDc([in] Hlong WINHDC)

static void HOperatorSet.SetWindowDc(HTuple windowHandle, HTuple WINHDC)

void HWindow.SetWindowDc(IntPtr WINHDC)

Description

set_window_dcset_window_dcSetWindowDcset_window_dcSetWindowDcSetWindowDc sets the device context of a window previously opened with new_extern_windownew_extern_windowNewExternWindownew_extern_windowNewExternWindowNewExternWindow. All output (disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion, disp_imagedisp_imageDispImagedisp_imageDispImageDispImage, etc.) is done in the window with this device context.

The parameter WINHDCWINHDCWINHDCWINHDCWINHDCWINHDC contains the device context of the window in which HALCON should output its data. This device context is used in all output routines of HALCON.

Attention

The window WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle has to be created with new_extern_windownew_extern_windowNewExternWindownew_extern_windowNewExternWindowNewExternWindow beforehand.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Window identifier.

WINHDCWINHDCWINHDCWINHDCWINHDCWINHDC (input_control)  pointer HTupleHTupleHTupleVARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

device context of WINHWnd.

Restriction: WINHDC != 0

Example (C++ (HALCON 5.0-10.0))

HTuple m_tHalconWindow ;
Hobject m_objImage ;

WM_CREATE:
/* here you should create your extern halcon window*/
HTuple tWnd ;
set_check("~father") ;
tWnd = (Hlong)(m_hWnd) ;
new_extern_window(tWnd, 0, 0, sizeTotal.cx, sizeTotal.cy,
                  &m_tHalconWindow) ;
set_check("father") ;

WM_PAINT:
/* here you can draw halcon objects */
if (m_thWindow != -1) {
  HTuple tDC ;
  /* don't forget to set the dc !! */
  tDC = (Hlong)GetWindowDC(Control) ;
  set_window_dc(m_tHalconWindow,tDC) ;
  disp_obj(pDoc->m_objImage, m_tHalconWindow) ;
  /* release the graphic objects */
  set_window_dc(m_tHalconWindow, 0) ;
  ReleaseDC((Hlong)tDC) ;
}

WM_CLOSE:
/* close the halcon window */
if (m_tHalconWindow != -1) {
      close_window(m_tHalconWindow) ;
}

Result

If the values of the specified parameters are correct, set_window_dcset_window_dcSetWindowDcset_window_dcSetWindowDcSetWindowDc returns 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

new_extern_windownew_extern_windowNewExternWindownew_extern_windowNewExternWindowNewExternWindow

Possible Successors

disp_imagedisp_imageDispImagedisp_imageDispImageDispImage, disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion

See also

new_extern_windownew_extern_windowNewExternWindownew_extern_windowNewExternWindowNewExternWindow, disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion, disp_imagedisp_imageDispImagedisp_imageDispImageDispImage, disp_colordisp_colorDispColordisp_colorDispColorDispColor, set_lutset_lutSetLutset_lutSetLutSetLut, query_colorquery_colorQueryColorquery_colorQueryColorQueryColor, set_colorset_colorSetColorset_colorSetColorSetColor, set_rgbset_rgbSetRgbset_rgbSetRgbSetRgb, set_hsiset_hsiSetHsiset_hsiSetHsiSetHsi, set_pixelset_pixelSetPixelset_pixelSetPixelSetPixel, set_grayset_graySetGrayset_graySetGraySetGray, set_partset_partSetPartset_partSetPartSetPart, set_part_styleset_part_styleSetPartStyleset_part_styleSetPartStyleSetPartStyle, query_window_typequery_window_typeQueryWindowTypequery_window_typeQueryWindowTypeQueryWindowType, get_window_typeget_window_typeGetWindowTypeget_window_typeGetWindowTypeGetWindowType, set_window_typeset_window_typeSetWindowTypeset_window_typeSetWindowTypeSetWindowType, get_mpositionget_mpositionGetMpositionget_mpositionGetMpositionGetMposition, set_tpositionset_tpositionSetTpositionset_tpositionSetTpositionSetTposition, set_window_extentsset_window_extentsSetWindowExtentsset_window_extentsSetWindowExtentsSetWindowExtents, get_window_extentsget_window_extentsGetWindowExtentsget_window_extentsGetWindowExtentsGetWindowExtents, set_window_attrset_window_attrSetWindowAttrset_window_attrSetWindowAttrSetWindowAttr, set_checkset_checkSetCheckset_checkSetCheckSetCheck, set_systemset_systemSetSystemset_systemSetSystemSetSystem

Module

Foundation


ClassesClassesClassesClasses | | | | Operators