Esempio n. 1
0
        //检测图片并且指定是否需要重拍
        private void CheckShootPhoto(Bitmap bitmap)
        {
            try
            {
                // 当前选中行Index态
                int rowIndex = this.dataGridView.SelectedRows[0].Index;
                // 照片命名
                string photoName = "" + this.dataGridView.Rows[rowIndex].Cells[this.comboBox_photoName.SelectedIndex].Value;
                if (photoName.Length == 0)
                {
                    photoName = "无名氏" + GetTimeStamp();
                }

                //直接检测图片并且指定是否需要重拍
                if (previewForm != null)
                {
                    previewForm.Dispose();
                    previewForm = null;
                }

                previewForm = new PreviewForm(bitmap, "当前照片检测 -- " + photoName, true);

                previewForm.Show();
                previewForm.Owner = this;
            }
            catch (Exception ex)
            {
                Console.WriteLine("+++++++++当前照片检测准备发生未知异常+++++++++");
                Console.WriteLine(ex.Message);
                //弹框提示
                MessageBox.Show(ex.Message, "当前照片检测准备异常");
            }
        }