• (zxing.net)二维码Aztec的简介、实现与解码


    一、简介

    Aztec Code是1995年,由Hand HeldProducts公司的Dr. Andrew Longacre设计。它是一种高容量的二维条形码格式。它可以对ASCII和扩展ASCII码进行编码。当使用最高容量和25%的纠错级别的時候,Aztec可以对3000个字符或者3750个数字进行编码。

    Aztec的矩阵大小在15 X 15和151 X 151之间变化。每个最小单位非黑即白。

    它独特的位于正中的模式识别标志和安置算法使Aztec看起来像个旋涡一样。

    Aztec打印解决方案允许用户选择大小和纠错级别。一共有36中不同的格式供选择,此外还有19种纠错级别可供选择,默认纠错级别是5级23%。高纠错级别意味着更少的数据容量和更小的误码机会。

    、实现

     1         public ActionResult AZTEC()
     2         {
     3             AztecEncodingOptions options = new AztecEncodingOptions();
     4             options.ErrorCorrection = 20;   //纠错级别  5、10、15、20、23、25、30、35、40、45、50、55、60、65、70、75、80、85、90 一共19个级别
     5             options.Layers = 0;     //数据层 0-32 数字越大图片越复杂
     6             options.Width = 150;
     7             options.Height = 150;
     8 
     9             BarcodeWriter writer = new BarcodeWriter();
    10             writer.Format = BarcodeFormat.AZTEC;
    11             writer.Options = options;
    12 
    13             //如需设置图片为其它颜色,使用此段代码
    14             BitmapRenderer renderer = new BitmapRenderer();
    15             renderer.Foreground = Color.Blue;
    16             renderer.Background = Color.White;
    17             writer.Renderer = renderer;
    18 
    19             Bitmap bmp = writer.Write("BarCodeSoft Aztec bar code");
    20             MemoryStream ms = new MemoryStream();
    21             bmp.Save(ms, ImageFormat.Png);
    22             ms.Flush();
    23             ms.Position = 0;
    24             return File(ms, "application/x-png");
    25         }

    测试图像如下:

       

    、解码

      点击查看

  • 相关阅读:
    软件包的作用
    Sqlserver2008 表分区教程
    C#通用类型转换 Convert.ChangeType
    缓存 HttpContext.Current.Cache和HttpRuntime.Cache的区别
    用户信息 Froms验证票证
    .NET4.0 __doPostBack未定义
    TFS2012 安装 配置笔记
    MVC学习笔记一
    新博客..第一天..
    ORACLE多表查询优化
  • 原文地址:https://www.cnblogs.com/weiweixiang/p/10075052.html
Copyright © 2020-2023  润新知