如何将 EPSON ESC/P 字节流转换为位图?
我通过串行 COM 端口连接设备,从中获取 Epson ESC/P 格式的字符串。
是否可以使用此流提供某些 C# 类,然后将结果保存为图像 或者直接打印结果?
喜欢 System.Drawing.Printing.PrintDocument thePrintDocument = new System.Drawing.Printing.PrintDocument();
thePrintDocument.FeedWithESCP(myString); thePrintDocument.SaveThisAsPng(myFile);
问候斯特凡
I am interfacing a device via a serial COM port from which I get a string of characters in the Epson ESC/P format.
Is it possible to feed some C# class with this stream and then save the result as an image
or print the result directly ?
Like
System.Drawing.Printing.PrintDocument thePrintDocument = new System.Drawing.Printing.PrintDocument();
thePrintDocument.FeedWithESCP(myString);
thePrintDocument.SaveThisAsPng(myFile);
Regards Stefan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个简单的解决方案,它获取从 epson 打印机接收的字节。
这不是 Epson ESC/P 协议的完整实现,但对我来说已经足够了
byte[] myData 是从打印机接收的流
Here is a simple solution that takes the bytes received from the epson printer.
This is not a complete implementation of the Epson ESC/P protocol but it is enough for me
byte[] myData is the stream received from the printer