コード例 #1
0
 private void btn_generateqrcode_Click(object sender, EventArgs e)
 {
     if (txtbox_text.Text == "")
     {
         MessageBox.Show("文本框不能为空!");
         txtbox_text.Focus();
     }
     else
     {
         //picturebox_qrcode.Image = ZxingCode.GenerateBarcode(txtbox_text.Text, 300, 300);
         picturebox_qrcode.Image = ZxingCode.GenerateQRCode(txtbox_text.Text, 300, 300);
         //picturebox_qrcode.Image = ZxingCode.GenerateQRCodeWithLOGO(txtbox_text.Text, 300, 300);
     }
 }
コード例 #2
0
        private void btn_decodingqrcode_Click(object sender, EventArgs e)
        {
            Tuple <bool, string, string> tup = ZxingCode.DecodeQRCode(txtbox_qrcodeurl.Text);

            if (tup.Item1 == true)
            {
                txtbox_text.Text = tup.Item2;
            }
            else
            {
                MessageBox.Show(tup.Item2);
                txtbox_qrcodeurl.SelectAll();
                txtbox_qrcodeurl.Focus();
            }
        }
コード例 #3
0
        private void 扫描屏幕二维码ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tuple <bool, string> tup = ZxingCode.ScanScreenQRCode();

            if (tup.Item1 == true)
            {
                txtbox_text.Text        = tup.Item2;
                picturebox_qrcode.Image = ZxingCode.GenerateQRCode(tup.Item2, 300, 300);
                this.Show();
                this.WindowState = System.Windows.Forms.FormWindowState.Normal;
            }
            else
            {
                MessageBox.Show(tup.Item2);
            }
        }
コード例 #4
0
        private void btn_scanscreenqrcode_Click(object sender, EventArgs e)
        {
            Reset();

            Tuple <bool, string> tup = ZxingCode.ScanScreenQRCode();

            if (tup.Item1 == true)
            {
                txtbox_text.Text        = tup.Item2;
                picturebox_qrcode.Image = ZxingCode.GenerateQRCode(tup.Item2, 300, 300);
            }
            else
            {
                MessageBox.Show(tup.Item2);
            }
        }