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);
}

posted on 2018-05-03 11:24  qqhfeng16  阅读(145)  评论(0编辑  收藏  举报