spire.barcode 4.9.2现已发布。该版本支持设置条码顶部文本的排列方式,同时也支持在条形码底部添加自定义文本。除此之外,一些在扫描条形码和qr码时出现的问题也得以成功解决。详情请查阅以下内容。
新功能:
- 支持设置条码顶部文本的排列方式。
int width = 399;
int height = 159;
barcodesettings bs = new barcodesettings();
bs.type = barcodetype.upca;
bs.unit = graphicsunit.pixel;
bs.widenarrowratio = 0.5f;
bs.textfont = new font("arial", 20, fontstyle.regular);
string data = "602318275035";
bs.data2d = data;
bs.data = data;
bs.showtextonbottom = true;
bs.toptext = data;
bs.showtoptext = true;
bs.textalignment = stringalignment.center;
bs.toptextaligment = stringalignment.center;
bs.toptextfont = new font("arial", 20, fontstyle.regular);
bs.autoresize = false;
bs.x = 3.0f;
bs.barheight = height * 0.6f;
bs.imagewidth = width;
bs.imageheight = height;
barcodegenerator generator = new barcodegenerator(bs);
image barimage = generator.generateimage();
barimage.save(outputfile_img, imageformat.png);
barcodesettings barsetting = new barcodesettings();
barsetting.type=barcodetype.ean13;
barsetting.backcolor = color.whitesmoke;
string data = "6901234567892";
barsetting.data=data;
barsetting.data2d=data;barsetting.toptext="ean13";
barsetting.toptextfont=new font("arial", 20, fontstyle.regular);
barsetting.toptextcolor=color.red;
barsetting.showtoptext=true;
barsetting.showtextonbottom=true;
barsetting.toptextaligment=stringalignment.center;
barsetting.bottomtext="ean";
barsetting.bottomtextfont=new font("fangsong", 25, fontstyle.bold);
barsetting.bottomtextcolor=color.black;
barsetting.showbottomtext=true;
barsetting.bottomtextaligment=stringalignment.far;
barcodegenerator generator = new barcodegenerator(barsetting);
image barcode = generator.generateimage();
barcode.save(outputfile_img);
问题修复:
- 修复了扫描条形码得到的数据不正确的问题。
- 修复了扫描条形码失败的问题。
- 修复了扫描条形码程序抛“nullpointerexception”的问题。
- 修复了添加自定义文本不生效的问题。
- 修复了扫描含特殊字符的qr码,得到的数据错误的问题。
获取spire.barcode 4.9.2请点击: