halcon中flush_buffer刷新界面

 read_image (Image, 'printer_chip/printer_chip_01')
threshold (Image, Region, 128, 255)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
set_window_param (WindowHandle, 'flush', 'false')
dev_display (Image)
dev_display (Region)
disp_text (WindowHandle, 'Result of threshold', 'window', \
           12, 12, 'black', [], [])
* nothing is displayed until flush_buffer is called
flush_buffer (WindowHandle)
 
 
下面这种方式已经不用了
set_system ('flush_graphic', 'false')
 
disp()
 
set_system ('flush_graphic', 'true')
 

'flush_graphic':
After each HALCON operation which creates a graphic output, a flush operation will be executed in order to display the data immediately on screen. This is not necessary for all programs, e.g., if everything is done with the help of the mouse. In this case 'flush_graphic' can be set to 'false' to improve the runtime. Note that this parameter has no effect on Unix-like systems because there, the window managers flush the display buffer automatically.

Note that using 'flush_graphic' is no longer recommended with HALCON 13 or later versions, since it can lead to unexpected results. Instead, please set the parameter 'flush' of set_window_param to 'false' and call flush_buffer to transfer the buffer to the graphics window.

posted @ 2020-05-15 16:03  QuincyYi  阅读(939)  评论(0)    收藏  举报