有没有办法在以下代码中使用存储在 Zebra 打印机中的图像:
Dim g As Graphics = e.Graphics
Dim bc As New BarcodeProfessional
Dim br As Brush = New SolidBrush(Drawing.Color.Black)
Dim blackPen As New Pen(Color.Black, 5)
e.Graphics.DrawArc(blackPen, 10, 10, 70, 50, 130, 100)
g.DrawString("UPC", Arial_6_bold, br, 210, 15)
上面打印了一个弧线和一个“UPC”文本,现在我可以在这里打印存储在 Zebra 打印机中的图像吗?
我发现我可以通过这种方式将 ZPL 代码发送到打印机:
Dim ipAddress As String = "10.3.14.59"
Dim port As Integer = 9100
Dim ZPLString As String = _
"^XA" & _
"^FO50,50" & _
"^A0N,50,50" & _
"^FDHello, World!^FS" & _
"^XZ"
Try
'Open Connection
Dim client As New System.Net.Sockets.TcpClient
client.Connect(ipAddress, port)
'Write ZPL String to Connection
Dim writer As New System.IO.StreamWriter(client.GetStream())
writer.Write(ZPLString)
writer.Flush()
'Close Connection
writer.Close()
client.Close()
Catch ex As Exception
'Catch Exception Here
End Try
但是我不知道如何将两个代码放在一起,知道吗?