private void toolStripButton_clip_output_Click(object sender, EventArgs e) { if (this.pictureBox_clip.Image == null) { MessageBox.Show(this, "没有可以输出的图像"); return; } using (Bitmap bitmap = new Bitmap(this.pictureBox_clip.Image)) { this.Image = AForgeImageUtil.Clip(bitmap, this.pictureBox_clip.GetCorners()); } this.tabControl_main.SelectedTab = this.tabPage_result; }
private void toolStripButton_getAndClose_Click(object sender, EventArgs e) { if (this.tabControl_main.SelectedTab == this.tabPage_preview) { this.Image = this.qrRecognitionControl1.Image; } else if (this.tabControl_main.SelectedTab == this.tabPage_clip) { using (Bitmap bitmap = new Bitmap(this.pictureBox_clip.Image)) { this.Image = AForgeImageUtil.Clip(bitmap, this.pictureBox_clip.GetCorners()); } } this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }