相关疑难解决方法(0)

如何在Labelary中使用BMP到ZPL的ASCII HEX优化

我想编写一个将位图图像转换为zpl的代码.我找到了以下代码:

string bitmapFilePath = @"D:\Demo.bmp";
int w, h;
Bitmap b = new Bitmap(bitmapFilePath);
w = b.Width; h = b.Height;
byte[] bitmapFileData = System.IO.File.ReadAllBytes(bitmapFilePath);
int fileSize = bitmapFileData.Length;

// The following is known about test.bmp.  It is up to the developer
// to determine this information for bitmaps besides the given test.bmp.
int bitmapDataOffset = int.Parse(bitmapFileData[10].ToString()); ;
int width = w; // int.Parse(bitmapFileData[18].ToString()); ;
int height = h; // int.Parse(bitmapFileData[22].ToString()); ;
int bitsPerPixel = int.Parse(bitmapFileData[28].ToString()); // Monochrome image required!
int bitmapDataLength …
Run Code Online (Sandbox Code Playgroud)

.net c# zpl

2
推荐指数
1
解决办法
2222
查看次数

标签 统计

.net ×1

c# ×1

zpl ×1