码迷,mamicode.com
首页 > Windows程序 > 详细

c#,条码

时间:2018-05-03 11:37:28      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:常用   coding   name   c#   stat   filename   gen   enc   生成   

static void Generate2(string text)
{
BarcodeWriter writer = new BarcodeWriter();
//使用ITF 格式,不能被现在常用的支付宝、微信扫出来
//如果想生成可识别的可以使用 CODE_128 格式
//writer.Format = BarcodeFormat.ITF;
writer.Format = BarcodeFormat.CODE_128;
EncodingOptions options = new EncodingOptions()
{
Width = 150,
Height =50,
Margin=2
};
writer.Options = options;
Bitmap map = writer.Write(text);
string filename = @"H:\桌面\截图\generate2.png";
map.Save(filename, ImageFormat.Png);
}

c#,条码

标签:常用   coding   name   c#   stat   filename   gen   enc   生成   

原文地址:https://www.cnblogs.com/qqhfeng/p/8984490.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!