一、简介

一维码Code 93: Code 93码与Code 39码的字符集相同,但93码的密度要比39码高,因而在面积不足的情况下,可以用93码代替39码。它没有自校验功能,为了确保数据安全性,采用了双校验字符,其可靠性比39条码还要高.

一维码Code 39的介绍可以参考:https://www.cnblogs.com/weiweixiang/p/10075260.html

二、实现

         public ActionResult CODE_93()
{
EncodingOptions options = new EncodingOptions();
options.PureBarcode = false; //是否将内容字符串显示在图片上。false 为显示 true为不显示
options.GS1Format = false; //是否符合GS1
options.Width = ; //图片宽度,根据内容的长度会自动增长
options.Height = ; //图片高度
options.Margin = ; //填充,在图片左右填充空白 30则左右各15 BarcodeWriter writer = new BarcodeWriter();
writer.Format = BarcodeFormat.CODE_93;
writer.Options = options; //如需设置图片为其它颜色,使用此段代码
//BitmapRenderer renderer = new BitmapRenderer();
//renderer.Foreground = Color.Black;
//renderer.Background = Color.White;
//renderer.TextFont = new Font(FontFamily.GenericSansSerif, 10); //内容字体
//writer.Renderer = renderer; Bitmap bmp = writer.Write("");
MemoryStream ms = new MemoryStream();
bmp.Save(ms, ImageFormat.Png);
ms.Flush();
ms.Position = ;
return File(ms, "application/x-png");
}

测试图像如下:

(zxing.net)一维码Code 93的简介、实现与解码-LMLPHP

三、解码

  点击查看

05-11 16:00