如何使用^ DG命令将图像发送到java中的斑马打印机? [英] How to use the ^DG command send image to a zebra printer in java?
问题描述
有人知道如何将图像(例如* .bmp文件)转换为java中的HEX字符串,因此可以在^ DG命令(zpl中的命令之一)中使用HEX字符串。谢谢!
Is anyone know how to convert a image(such as *.bmp files) to HEX string in java,so the HEX string can used in the ^DG command(one of command in zpl).thanks!
推荐答案
这并不容易。您必须将图像转换为每像素1位数,然后计算包括每行字节数的大小,然后正确形成 ~DG
命令来存储它。
It's not easy. You have to convert the image to 1-bit per pixel b/w, and then calculate the size including the bytes per row, and then properly form up the parameters of the ~DG
command to store it.
或者......
Zebra提供了一个API来将图像转换为GRF(斑马内部图像类型)。包中有许多开发人员演示,包括如何在打印机上将图像打印/存储为GRF的演示
Zebra provides an API to convert images to GRFs (Zebra internal image type). There are a bunch of developer demos in the package, including a demo on how to print/store an image as a GRF on your printer
希望这有助于
这篇关于如何使用^ DG命令将图像发送到java中的斑马打印机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!