HALCON provides a functionality that emulates the behavior of HDevelop graphics windows for HALCON windows. This HALCON window stack is accessible via class methods and functions in the HALCON interfaces, and code exported from HDevelop uses this functionality when opening, closing, setting, or accessing the active window. The HALCON window stack mechanism is threadsafe and can be shared among threads. Though, in a multithreaded application the user has to take care when switching the active window in different threads, as setting it in one thread will also set it for other threads.
For the .NET code export it is optional whether to export HDevelop programs as code using the HDevelop export example templates or as code using the previously described HALCON window stack functionality when doing graphics windows output. Additionally, in the latter case the exported code contains a main function and thus is usable as a standalone application. The HDevelop Export dialog allows you to select the corresponding option.
The graphics windows of HDevelop and the basic windows of the HALCON libraries
have different functionality.
In the export of Visual Basic .NET, and C# programs using the option Use Export Template, all window operations are suppressed, because the exported code is intended to work together with the corresponding template. If you want to use more than one window in programs exported in this mode, you have to modify the code and project manually.
Note that the export of programs containing multiple windows using the option Use HALCON Windows might be incorrect if the active graphics window was changed using the mouse during program execution. It is recommended to use the operator dev_set_window explicitly to achieve the same functionality.
When generating code using the option Use HALCON Windows, close the default graphics window (using dev_close_window) and open a new one (using dev_open_window) before the first call of dev_display in order to assure a correct export.
dev_set_part (0, 0, ImageHeight-1, ImageWidth-1) dev_display (Image)
In this example, Image is the image variable, ImageHeight and ImageWidth denote its size. You can query the size of an image with the operator get_image_size. Please consult the HALCON Reference Manuals for more details.
Note that the operator dev_set_part (and its HALCON library equivalent set_part) is more commonly used for displaying (and thereby zooming) parts of images. By calling it with the full size of an image as shown above, you assure that the image exactly fits the window.