index:.../Application/Data-Codes/pdf417_bottle.hdev
* This programs shows how to read 2d data codes of type PDF 417.
*
dev_update_off ()
dev_close_window ()
read_image (Image, 'datacode/pdf417/pdf417_bottle_01')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_set_line_width (3)
gen_rectangle1 (Rectangle, 250, 0, 600, 610)
dev_set_color ('green')
*
* Create a 2d data code model
create_data_code_2d_model ('PDF417', [], [], DataCodeHandle)
set_data_code_2d_param (DataCodeHandle, 'default_parameters', 'maximum_recognition')
*
NumImages := 6
for Index := 1 to NumImages by 1
* Read the image and decode the 2d data code
read_image (Image, 'datacode/pdf417/pdf417_bottle_' + Index$'02')
reduce_domain (Image, Rectangle, ImageReduced)
count_seconds (T1)
find_data_code_2d (ImageReduced, SymbolXLDs, DataCodeHandle, [], [], ResultHandles, DecodedDataStrings)
count_seconds (T2)
Time := 1000 * (T2 - T1)
*
* Display the runtime and the found symbols
dev_set_window (WindowHandle)
dev_display (Image)
dev_display (SymbolXLDs)
disp_message (WindowHandle, 'Data code found in ' + Time$'.1f' + ' ms', 'window', 12, 12, 'black', 'true')
for I := 1 to |ResultHandles| by 1
Length := strlen(DecodedDataStrings[I - 1])
Message := ['Value:',DecodedDataStrings[I - 1]{0:(Length / 2) - 1},DecodedDataStrings[I - 1]{Length / 2:Length - 1}]
disp_message (WindowHandle, Message, 'image', (I + 1) * 24, 12, 'black', 'true')
endfor
if (Index != NumImages)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
endif
endfor
*
* Clear the 2d data code model
clear_data_code_2d_model (DataCodeHandle)
简单的程序
实现效果如图