三
我们的软件是生成二维码的软件
代码如下”
生成二维码-生成 private void button3_Click(object sender, EventArgs e) { //设置QR二维码的规格 ZXing.QrCode.QrCodeEncodingOptions qrEncodeOption = new ZXing.QrCode.QrCodeEncodingOptions(); //设置编码格式,否则中文乱码 qrEncodeOption.CharacterSet = "UTF-8"; //设置宽和高 qrEncodeOption.Height = 200; qrEncodeOption.Width = 200; //设置周围空白边距 qrEncodeOption.Margin = 1; ZXing.BarcodeWriter wr = new BarcodeWriter(); //二维码 wr.Format = BarcodeFormat.QR_CODE; wr.Options = qrEncodeOption; //生成二维码 Bitmap image = wr.Write(textBox4.Text); //显示 pictureBox3.Image = image; } //生成二维码-保存 private void button7_Click(object sender, EventArgs e) { //保存图片 saveImage(pictureBox3, textBox4.Text); } //读取二维码-选择图片 private void button5_Click(object sender, EventArgs e) { //打开图片 openImage(textBox6, pictureBox4); }