While it is possible to fill all input members of the BARCODE and LogFnt structures directly it is more efficient to retrieve from the DLL the current values (the defaults if no filling has been done either programmatically or by using the PbarcodeSetup or FbarcodeSetup macros), and then changing just the values you need to change. The structure may then be returned to the DLL.
The current structure, along with the current font structure used for the human readable font used for picture barcodes may be retrieved by calling BarCdrd() and the modified structures returned by calling BarCdin() as shown in the sample code below, which changes only the barcode type by setting the code value to 9, the human readable font to Arial, and the image height and width to 15 and 35 mm respectively.
Declare Function BarCdrd Lib “Dlsbar34” (bc As Barcode, lf
As LogFont) As Long
Declare Function BarCdin Lib “Dlsbar34” (bc As Barcode,
lf As LogFont) As Long
Declare Function SetBarCdsz Lib “Dlsbar34” (ht As
Long, wd As Long)
Dim bc as BARCODE
Dim lf as LogFnt
Private Sub
Cchange()
Dim i As Long
Dim ht As Long
Dim wd As Long
Dim tfnt As
String
i = BarCdrd(bc, lf)
bc.code = 9
tfnt = "Arial"
n =
Len(tfnt)
For i = 0 To n – 1
lf.lfFaceName(i) =
Asc(Mid$(tfnt, i + 1, 1))
Next i
lf.lfFaceName(n) =
0
ht=1500
wd=3500
i=SetBarCdsz(ht,wd)
i = BarCdin(bc, lf)
End
Sub
More: