Name
set_window_dcset_window_dcSetWindowDcset_window_dcSetWindowDcSetWindowDc — Set the device context of a virtual graphics window (Windows NT).
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.
The window WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle has to be created with
new_extern_windownew_extern_windowNewExternWindownew_extern_windowNewExternWindowNewExternWindow beforehand.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: local (may only be called from the same thread in which the window, model, or tool instance was created).
- Processed without parallelization.
devicecontext of WINHWnd.
Restriction: WINHDC != 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) ;
}
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.
new_extern_windownew_extern_windowNewExternWindownew_extern_windowNewExternWindowNewExternWindow
disp_imagedisp_imageDispImagedisp_imageDispImageDispImage,
disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion
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
Foundation