侧边栏壁纸
  • 累计撰写 48 篇文章
  • 累计创建 19 个标签
  • 累计收到 7 条评论

目 录CONTENT

文章目录

C#根据字符串获取条形码图片

轨迹
2024-09-04 / 0 评论 / 0 点赞 / 175 阅读 / 108 字 / 正在检测是否收录...
/// <summary>
        /// 获取条形码图片
        /// </summary>
        /// <param name="BarcodeString"></param>
        /// <param name="ImgWidth"></param>
        /// <param name="ImgHeight"></param>
        /// <returns></returns>
        public static Image CreateBarcodePicture(string BarcodeString, int ImgWidth, int ImgHeight)
        {
            Barcode b = new Barcode();//实例化一个条码对象
            TYPE type = TYPE.CODE128;//编码类型

            //获取条码图片
            System.Drawing.Image BarcodePicture = b.Encode(type, BarcodeString, System.Drawing.Color.Black, System.Drawing.Color.White, ImgWidth, ImgHeight);
            // b.Dispose();
            return BarcodePicture;
        }
0

评论区