关于C# Winform 程序中使用二维码的使用记录:
1、使用 Nuget
安装 ZXing.Net 程序包;
2、调用代码:
private void button1_Click(object sender, EventArgs e)
{BarcodeWriter writer = new BarcodeWriter();writer.Format = BarcodeFormat.QR_CODE;QrCodeEncodingOptions options = new QrCodeEncodingOptions(){DisableECI = true,CharacterSet = "UTF-8",Width = pictureBox1.Width,Height = pictureBox1.Height,Margin = 1};writer.Options = options;Bitmap map = writer.Write("生成二维码测试生成二维码测试生成二维码测试生成二" +"维码测试生成二维码测试生成二维码测试生成二维码测试生成二维码测试生成二维" +"码测试生成二维码测试生成二维码测试生成二维码测试生成二维码测试生成二维码测试生成二维码测试");pictureBox1.Image = map;
}