我正在尝试使用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字符(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”
我也尝试过使用代码A的末尾字符(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
正确的做法是什么?
答案 0 :(得分:0)
您不能通过在输入字符串中放入Start Code A
,Start Code B
等代码来强制ZXing.NET切换代码集。相反,它将分析您的输入字符串并根据支持的字符自动决定如何对它进行编码。
有关更多详细信息,请阅读chooseCode
方法on GitHub的实现。