100分求救!C#打印39条形码的问题!
C#打印39条形码的问题
如何搞定!
刚从WEBFORM转到WINFORM有些问题不会,问问,100分
------解决方案--------------------用GDI+慢慢画吧!
------解决方案--------------------用条码字体设置好你要打的东西,下满和打印一般文档一样,定义好纸张大小就ok了,
------解决方案--------------------http://www.cobainsoft.com/downloads/downloaddetail.aspx?id=12
------解决方案--------------------Private Sub PrintBarCode( _
ByVal strBarCode As String, _
Optional ByVal intXPos As Integer = 0, _
Optional ByVal intYPos As Integer = 0, _
Optional ByVal intPrintHeight As Integer = 10, _
Optional ByVal bolPrintText As Boolean = True _
)
' 参数说明:
' strBarCode - 要打印的条形码字符串
' intXPos, intYPos - 打印条形码的左上角坐标(缺省为(0,0),坐标刻度为:毫米)
' intHeight - 打印高度(缺省为一厘米,坐标刻度为:毫米)
' bolPrintText - 是否打印人工识别字符(缺省为true)
' "0 "- "9 ", "A-Z ", "- ", "% ", "$ "和 "* " 的条码编码格式,总共 40 个字符
Static strBarTable(39) As String
' 初始化条码编码格式表
strBarTable(0) = "001100100 " ' 0
strBarTable(1) = "100010100 " ' 1
strBarTable(2) = "010010100 " ' 2
strBarTable(3) = "110000100 " ' 3
strBarTable(4) = "001010100 " ' 4
strBarTable(5) = "101000100 " ' 5
strBarTable(6) = "011000100 " ' 6
strBarTable(7) = "000110100 " ' 7
strBarTable(8) = "100100100 " ' 8
strBarTable(9) = "010100100 " ' 9
strBarTable(10) = "100010010 " ' A
strBarTable(11) = "010010010 " ' B
strBarTable(12) = "110000010 " ' C
strBarTable(13) = "001010010 " ' D
strBarTable(14) = "101000010 " ' E
strBarTable(15) = "011000010 " ' F
strBarTable(16) = "000110010 " ' G
strBarTable(17) = "100100010 " ' H
strBarTable(18) = "010100010 " ' I
strBarTable(19) = "001100010 " ' J
strBarTable(20) = "100010001 " ' K
strBarTable(21) = "010010001 " ' L
strBarTable(22) = "110000001 " ' M
strBarTable(23) = "001010001 " ' N
strBarTable(24) = "101000001 " ' O
strBarTable(25) = "011000001 " ' P
strBarTable(26) = "000110001 " ' Q