我正在尝试用ZXing制作条形码,但我不能强迫它使用CODE_A或CODE_B,我已经尝试过:
BarcodeWriter w = new BarcodeWriter();
w.Format = BarcodeFormat.CODE_128;
w.Options.GS1Format = false;
w.Options.Width = 1;
w.Options.Height = (int)(Heightmm * (g.DpiY / 25.4f));
Bitmap img = w.Write("0123456789");生成CODE_C条形码
然后从CODE_A char (103) (Acording to Wikipedia)开始:
BarcodeWriter w = new BarcodeWriter();
w.Format = BarcodeFormat.CODE_128;
w.Options.GS1Format = false;
w.Options.Width = 1;
w.Options.Height = (int)(Heightmm * (g.DpiY / 25.4f));
Bitmap img = w.Write((char)103 +"0123456789");但只插入一个"g“(在CODE_B中)更改为CODE_C并插入"0123456789”
我也尝试过使用end Code A char (106)
BarcodeWriter w = new BarcodeWriter();
w.Format = BarcodeFormat.CODE_128;
w.Options.GS1Format = false;
w.Options.Width = 1;
w.Options.Height = (int)(Heightmm * (g.DpiY / 25.4f));
Bitmap img = w.Write((char)103 +"0123456789" + (char)106);但这次生成的条形码只在末尾插入一个j
正确的做法是什么?
发布于 2018-11-07 03:57:41
您不能通过在输入字符串中放入Start Code A、Start Code B等代码来强制ZXing.NET切换代码集。相反,它会分析你的输入字符串,并根据支持的字符自动决定如何编码。
有关更多详细信息,请阅读chooseCode方法on GitHub的实现。
https://stackoverflow.com/questions/53152798
复制相似问题