Subroutine Make(string ucData, long nDataLen, long nErrLevel, long nMask, integer nBarEdition, string szBmpFileName, long nScale) library "MakeQRBarcode.dll"
string ls_text,ls_file
ls_text = "abcdefg1234567890"
ls_file ="d:\barcode2d.bmp"
//只要mark参数的最后一个值3改为5,生成的二维码就可以在PB的picture 控件中显示出来了
Make(ls_text,Len(ls_text),2,0,0,ls_file,5)
//批量生成二维码bmp
long ll_i,ll_Selected
string ls_text,ls_file, ls_dw
n_cst_regsrv lnv_regsrv
if not DirectoryExists( "barbmp\" ) then CreateDirectory( "barbmp\" )
for ll_i=1 to dw_1.RowCount()
If dw_1.IsSelected(ll_i) Then
ls_text = dw_1.object.zcno[ll_i]
ls_dw = dw_1.object.ownerunit[ll_i]
ls_file = "barbmp\"+ls_dw+"_"+ls_text+".bmp"
lnv_regsrv.of_MakeQRbarcodePic(ls_text,ls_file)
ll_Selected = ll_Selected+1
End If
next
Messagebox(ls_file,"barbmp 二维码生成数量:"+string(ll_Selected))
// ====================================================================
// Event/Fun: of_MakeQRBarcodePic( string as_barcode,string as_picfilename)
// Returns:
// Description: 生成二维码图片 只要参数的最后一个值3改为5,生成的二维码就可以放心的在picture 控件中显示出来了
// --------------------------------------------------------------------
// Copyright (c) 2018-2025 GuangZhou Software Co.Ltd(TM), All rights reserved.
// --------------------------------------------------------------------
// Written in: 2018-10-5
// Modified in:
// ====================================================================
Make( as_barcode,Len(as_barcode),2,0,0, as_picfilename,5)
return
在dw中显示二维码:
在dw(标签)中新建一个计算对象 computed field,计算表达式为:
bitmap ( "barbmp\"+ ownerunit +"_"+zcno +".bmp")