Пример #1
0
        /// <summary>
        /// 拖入二维码的时候。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainForm_DragEnter(object sender, DragEventArgs e)
        {
            var paths = e.Data.GetData(typeof(string[])) as string[];

            richTextBox1.Text   = QRCoderHelper.QrDecoder(paths[0]);
            pictureBox1.Image   = new Bitmap(paths[0]);
            qrBitmap            = new Bitmap(paths[0]);
            panel1.Visible      = false;
            pictureBox1.Visible = true;
            BtnMakeQr.Text      = "重新生成";
            triggerDrag         = true;
        }
Пример #2
0
 /// <summary>
 /// 检测二维码是否可用
 /// </summary>
 private void CheckQrCodeWorks()
 {
     if (qrBitmap == null)
     {
         MessageBox.Show("未生成二维码", "出错了!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (QRCoderHelper.QrDecoder(qrBitmap) != "error")
     {
         MessageBox.Show("检测结果:该二维码可用~", "检测完成", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         triggerChecked = true;
         return;
     }
     else
     {
         MessageBox.Show("检测结果:该二维码不可用,可能是二维码内容超出限制。" + "\n" + "                建议提高\'容量级别\'~", "检测完成", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         triggerChecked = false;
         return;
     }
 }