**顺序也很重要,必须现有窗口,才能设置属性

dev_close_window()

dev_open_window (0, 0, 1400, 1200, 'black', WindowHandle)

dev_set_draw ('margin')

dev_set_color('green')

dev_set_line_width(5)

dev_update_window('off')

* Image Acquisition 01: Code generated by Image Acquisition 01

open_framegrabber ('DahengCAM', 1, 1, 0, 0, 0, 0, 'interlaced', 8, 'rgb', -1, 'false', 'SV-xxxx', '1', 1, -1, AcqHandle)

grab_image_start (AcqHandle, -1)

** 必须是2行,第一行不出结果(是黑色图像)

grab_image_async (Image, AcqHandle, -1)

grab_image_async (Image, AcqHandle, -1)

* Image Acquisition 01: Do something

create_bar_code_model ([], [], BarCodeHandle)

find_bar_code (Image, SymbolRegions, BarCodeHandle, 'Code 128', DecodedDataStrings)


dev_display (Image)

dev_display (SymbolRegions)

if(|DecodedDataStrings|>0)

set_tposition (WindowHandle, 24, 12)

write_string (WindowHandle, DecodedDataStrings)

endif


close_framegrabber (AcqHandle)

clear_bar_code_model (BarCodeHandle)