weat!!

二轮冲刺第二天

今天是我们团队冲刺的第二天

分配了每个人的任务

我的任务是编写生成二维码的代码

崔的任务是运行调试我编写的代码。


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

今日任务完成

 

posted on 2018-12-06 17:51  weat!!  阅读(80)  评论(0编辑  收藏  举报

导航