1Hlong mainwndid=(Hlong) m_hwnd;2Open_framegrabber ("File",4,4,0,0,0,0,"default", -1,"default", -1,"default",3 "","default", -1, -1, &acqhandle);4Grab_image (&Image, acqhandle);5Get_image_pointer1 (image, &pointer, &type, &width, &Height);6Set_window_attr ("Background_color","Black");7Set_window_attr ("Border_color"," White");8 9Open_window (20,140,width,height,mainwndid, "", "", &windowhandle);TenDisp_obj (Image, windowhandle);
The above section of code is to load a bitmap from the file, assorted first, we look at the Open_window () function.
Don't say a word more first
This is the main program window
Here's the point, we use the VS self-tool Spy + + to capture the black part of the program's main window:
Clearly, the black part has a handle: 00310780 is caption: "Halcon/win32-3600" is a class: HALCON not to mention that there is a style, but also occupy a part of the main window.
Yes, that's what Open_window did: create a window!!!!!
As for the window caption we can change it by set_window_attr ().
With this handle, Halcon can do anything with it and draw anything!!!!
OK, here we go!