| Table of Contents / Graphics / Window | Operators |
set_window_dc — Set the device context of a virtual graphics window (Windows NT).
set_window_dc( : : WindowHandle, WINHDC : )
set_window_dc sets the device context of a window previously opened with new_extern_window. All output (disp_region, disp_image, etc.) is done in the window with this device context.
The parameter WINHDC 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 WindowHandle has to be created with new_extern_window beforehand.
Window identifier.
HTuple m_tHalconWindow ;
Hobject m_objImage ;
WM_CREATE:
/* here you should create your extern halcon window*/
HTuple tWnd ;
set_check("~father") ;
tWnd = (INT)(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 = (INT)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((INT)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_dc returns 2 (H_MSG_TRUE). If necessary, an exception is raised.
new_extern_window, disp_region, disp_image, disp_color, set_lut, query_color, set_color, set_rgb, set_hsi, set_pixel, set_gray, set_part, set_part_style, query_window_type, get_window_type, set_window_type, get_mposition, set_tposition, set_window_extents, get_window_extents, set_window_attr, set_check, set_system
Foundation
| Table of Contents / Graphics / Window | Operators |
| HALCON Reference Manual 10.0.2 | Copyright © 1996-2011 MVTec Software GmbH |