c#,条码

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

猜你喜欢

转载自www.cnblogs.com/qqhfeng/p/8984490.html
C#