|
紫金桥条形码组件可以跟据客户的配置生成一维或者二维条形码。该组件需额外安装,标准安装包里不含此组件。
❈工程演示
根据组件说明书,安装组件。- 画面创建条码组件对象,命名为code1显示一维条码,code2显示二维条码
- DrawBarcode_One(String strCode, Int nStyle, Int nPen) As Bool
- 说明:
- 绘制一维条形码。
- 参数:
- strCode: 需要生成条码的字符串
- nStyle: 编码类别。0:39码、1:93码、2:128A码、3:128B码、4:128C码、5:CodeI2of5、6:CodeEan13。
- nPen: 画笔宽度。
- 返回值:
- 非 0 表示操作成功;0 表示失败。
复制代码- DrawBarcode_Two(String strCode, Int nVertion, Int nError) As Bool
- 说明:
- 绘制二维条形码。
- 参数:
- strCode: 需要生成条码的字符串
- nVertion: 版本。0:自动,1-40:对应QRCode码的1至40版本。建议使用自动方式。
- nError: 纠错级别。0:L级7%,1:M级15%,2:Q级25%,3:H级30%。
- 返回值:
- 非 0 表示操作成功;0 表示失败。
复制代码
- code1.DrawBarcode_One(txt1.Text,3,2)
复制代码
- code2.DrawBarcode_Two(txt2.Text,0,0)
复制代码
|
|