HALCON enables the user to save the content of the graphics window to a file: dump_window. This is helpful, for example, if image processing results should be available later on for review.
The saved image will have the same size as the graphics window. In order to use the original image size you can draw the content into an invisible or ‘buffer’ window. This window can be opened with the following command:
open_window(0, 0, Width, Height, 0, ‘buffer’, ”, BufferWindow)
The window can then be used just like a regular ‘visible’ window, i.e. all graphics operations for displaying, setting colours and drawing modes can be applied. To save the content to file just call
dump_window(BufferWindow, ‘png’, ‘Result.png’)
Another application of buffer windows is to prevent ‘flickering’, this sometimes occurs when results are displayed at dissimilar times during the cycle. This can be carried out by first displaying everything in the buffer window, then copying all content into the regular window:
copy_rectangle(BufferWindow, VisibleWindow, 0, 0, Width-1, Height-1, 0, 0)
Find out more about MVTec’s HALCON