I am trying to place in <FNC1>
separators in my ZXing barcode, I am not sure how these are supposed to be formatted in a string value. I have
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);
}
}
This code generates this image
Which is exactly <FNC1>42011111<FNC1>92612123456789000000155015
how can I interpolate and insert the FNC1 values? I tried using "]C1" which I found in this solution:
https://github.com/zxing/zxing/issues/475
But it did not work. Any help would be greatly appreciated.
The unicode character '\u00f1' instead of "<FNC1>" should work.