ZXing <FNC> GS1 条码分隔符
ZXing <FNC> Separator for GS1 bar code
我试图在我的 ZXing 条形码中放置 <FNC1>
分隔符,我不确定这些应该如何格式化为字符串值。我有
BarcodeWriterPixelData writer = new BarcodeWriterPixelData()
{
Format = BarcodeFormat.CODE_128,
Options = new ZXing.Common.EncodingOptions
{
Width = 554,
Height = 120
}
};
var pixelData = writer.Write("<FNC1>42011111<FNC1>92612123456789000000155015");
using (var bitmap = new Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
{
using (var ms = new System.IO.MemoryStream())
{
var bitmapData = bitmap.LockBits(new Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
try
{
// we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
}
finally
{
bitmap.UnlockBits(bitmapData);
}
// PNG or JPEG or whatever you want
bitmap.SetResolution(300, 300);
bitmap.Save(@"C:\Users\user\Desktop\newBarcode.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
此代码生成此图像
这完全是 <FNC1>42011111<FNC1>92612123456789000000155015
我如何插值和插入 FNC1 值?我尝试使用在此解决方案中找到的“]C1”:
https://github.com/zxing/zxing/issues/475
但是没有用。任何帮助将不胜感激。
Unicode 字符“\u00f1”而不是“”应该有效。
我试图在我的 ZXing 条形码中放置 <FNC1>
分隔符,我不确定这些应该如何格式化为字符串值。我有
BarcodeWriterPixelData writer = new BarcodeWriterPixelData()
{
Format = BarcodeFormat.CODE_128,
Options = new ZXing.Common.EncodingOptions
{
Width = 554,
Height = 120
}
};
var pixelData = writer.Write("<FNC1>42011111<FNC1>92612123456789000000155015");
using (var bitmap = new Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
{
using (var ms = new System.IO.MemoryStream())
{
var bitmapData = bitmap.LockBits(new Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
try
{
// we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
}
finally
{
bitmap.UnlockBits(bitmapData);
}
// PNG or JPEG or whatever you want
bitmap.SetResolution(300, 300);
bitmap.Save(@"C:\Users\user\Desktop\newBarcode.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
此代码生成此图像
这完全是 <FNC1>42011111<FNC1>92612123456789000000155015
我如何插值和插入 FNC1 值?我尝试使用在此解决方案中找到的“]C1”:
https://github.com/zxing/zxing/issues/475
但是没有用。任何帮助将不胜感激。
Unicode 字符“\u00f1”而不是“