*这个项目展示了’‘majority_voting’'对一维码读取的影响
- This example program shows the effect of the bar code
- parameter ‘majority_voting’.
- 一维码读取器分析并且解码多个扫描行。默认的,当一找到一行可以成功解码的扫描行时,就停止解码。
*在有些场合,由于打印质量原因,这一行代码有可能会是错的 - The bar code reader analyses multiple scanlines and tries
- to decode them. By default, this process is terminated as soon
- as one scanline can be decoded successfully. In some cases,
- the result derived from this scanline may be wrong due to
- local printing errors.
- 如果这个参数设定为’True’,不管正确与否,所有的扫描都会被分析与解码。最终结果由扫描到的最多数决定
- If the parameter ‘majority_voting’ is set to ‘true’, all
- scanlines are analysed. The final reading result is then
- determined by a majority voting of all successful decoding
- results.
- 准备可视化设置和对象
- Prepare visualization settings and objects
*关闭窗体更新
dev_update_off ()
*关闭窗体先
dev_close_window ()
*读取图像
read_image (Image, ‘barcode/ean13/ean13_label’)
*获取图像尺寸
get_image_size (Image, WidthI, HeightI)
*打开适合图像尺寸的窗体
dev_open_window_fit_image (Image, 0, 0, 600, 500, WindowHandle)
*显示图像
dev_display (Image)
*设置填充方式
dev_set_draw (‘margin’)
*设置显示字体
set_display_font (WindowHandle, 14, ‘mono’, ‘true’, ‘false’)
*限制窗体尺寸
get_win