首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在CODE_128中使用类似CODEA的特殊字符

如何在CODE_128中使用类似CODEA的特殊字符
EN

Stack Overflow用户
提问于 2018-11-05 18:43:34
回答 1查看 176关注 0票数 0

我正在尝试用ZXing制作条形码,但我不能强迫它使用CODE_A或CODE_B,我已经尝试过:

代码语言:javascript
复制
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)开始:

代码语言:javascript
复制
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)

代码语言:javascript
复制
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

正确的做法是什么?

EN

回答 1

Stack Overflow用户

发布于 2018-11-07 03:57:41

您不能通过在输入字符串中放入Start Code AStart Code B等代码来强制ZXing.NET切换代码集。相反,它会分析你的输入字符串,并根据支持的字符自动决定如何编码。

有关更多详细信息,请阅读chooseCode方法on GitHub的实现。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53152798

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档