ean13字体生成条形码扫描枪不识别
Public Function getEAN13CODE(strCode As String) As String
Dim str As String
Dim i As Integer, j As Integer, k As Integer, i_tmp As Integer
'str = "+"'Left(strCode, 1)
k = CInt(Left(strCode, 1))
str = ChrW(AscW("0") + k)
i = 2
While i <= Len(strCode)
j = CInt(Mid(strCode, i, 1))
Select Case i
Case 2
str = str + ChrW(65 + j)
Case 3
Select Case k
Case 0 To 3
i_tmp = 65
Case Else
i_tmp = 75
End Select
str = str + ChrW(i_tmp + j)
Case 4
Select Case k
Case 0, 4, 7, 8
i_tmp = 65
Case Else
i_tmp = 75
End Select
str = str + ChrW(i_tmp + j)
Case 5
Select Case k
Case 0, 1, 4, 5, 9
i_tmp = 65
Case Else
i_tmp = 75
End Select
str = str + ChrW(i_tmp + j)
Case 6
Select Case k
Case 0, 2, 5, 6, 7
i_tmp = 65
Case Else
i_tmp = 75
End Select
str = str + ChrW(i_tmp + j)
Case 7
Select Case k
Case 0, 3, 6, 8, 9
i_tmp = 65
Case Else
i_tmp = 75
End Select
str = str + ChrW(i_tmp + j) + ChrW(42) '"*"
Case Else
str = str + ChrW(97 + j)
End Select
i = i + 1
Wend
getEAN13CODE = str + ChrW(43) '"+"
End Function VBA ean13字体?条码
[解决办法]
会不会是有宽度和色深等区别,还是你的算法错了?
[解决办法]
建议研究一下条码扫描枪的说明书