Esempio n. 1
0
        private void button9_Click(object sender, EventArgs e)
        {
            String PathAddition;

            if (!this.ScanDateFolderNameFormat.Equals(""))
            {
                PathAddition = DateTime.Now.ToString(this.ScanDateFolderNameFormat) + "/";
            }
            else
            {
                PathAddition = "";
            }
            ScanWait ScanWaitWindow = new ScanWait(this.scanPath + PathAddition);

            if (ScanWaitWindow.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(this.ScanDelayTime);
                MessageBox.Show("搜索到的路径:" + ScanWaitWindow.ImageFilePath);
                Image DocumentImage = Image.FromFile(ScanWaitWindow.ImageFilePath);
                Image MemImage      = new Bitmap(DocumentImage);
                DocumentImage.Dispose();
                if (this.pictureBox1.Image != null)
                {
                    this.pictureBox1.Image.Dispose();
                }
                this.pictureBox1.Image = MemImage;
            }
            else
            {
                MessageBox.Show("取消");
            }
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (NameListBox.SelectedIndex == -1)
            {
                MessageBox.Show("请选择一位病人");
                return;
            }
            String PathAddition;

            if (!this.ScanDateFolderNameFormat.Equals(""))
            {
                PathAddition = DateTime.Now.ToString(this.ScanDateFolderNameFormat) + "/";
            }
            else
            {
                PathAddition = "";
            }
            ScanWait ScanWaitWindow = new ScanWait(this.scanPath + PathAddition);

            if (ScanWaitWindow.ShowDialog() == DialogResult.OK)
            {
                PatientInfo TempInfo    = this.SearchResult[this.NameListBox.SelectedIndex];
                String      desfilename = this.pPath + TempInfo.Name + "-" + TempInfo.HospitalId + ".jpg";
                MessageBox.Show("搜索到的路径:" + ScanWaitWindow.ImageFilePath);
                Thread.Sleep(this.ScanDelayTime);
                if (this.pictureBoxDocument.Image != null)
                {
                    this.pictureBoxDocument.Image.Dispose();
                }
                Image DocumentImage = Image.FromFile(ScanWaitWindow.ImageFilePath);
                DocumentImage.Save(desfilename, System.Drawing.Imaging.ImageFormat.Jpeg);
                DocumentImage.Dispose();
                System.Drawing.Image img = System.Drawing.Image.FromFile(desfilename);
                System.Drawing.Image bmp = new System.Drawing.Bitmap(img);
                img.Dispose();
                this.pictureBoxDocument.Image = bmp;
            }
            else
            {
                MessageBox.Show("取消");
            }
        }
 private void button2_Click(object sender, EventArgs e)
 {
     if (NameListBox.SelectedIndex == -1)
     {
         MessageBox.Show("请选择一位病人");
         return;
     }
     String PathAddition;
     if (!this.ScanDateFolderNameFormat.Equals(""))
     {
         PathAddition = DateTime.Now.ToString(this.ScanDateFolderNameFormat) + "/";
     }
     else
     {
         PathAddition = "";
     }
     ScanWait ScanWaitWindow = new ScanWait(this.scanPath + PathAddition);
     if (ScanWaitWindow.ShowDialog() == DialogResult.OK)
     {
         PatientInfo TempInfo = this.SearchResult[this.NameListBox.SelectedIndex];
         String desfilename = this.pPath + TempInfo.Name + "-" + TempInfo.HospitalId + ".jpg";
         MessageBox.Show("搜索到的路径:" + ScanWaitWindow.ImageFilePath);
         Thread.Sleep(this.ScanDelayTime);
         if (this.pictureBoxDocument.Image != null)
             this.pictureBoxDocument.Image.Dispose();
         Image DocumentImage = Image.FromFile(ScanWaitWindow.ImageFilePath);
         DocumentImage.Save(desfilename, System.Drawing.Imaging.ImageFormat.Jpeg);
         DocumentImage.Dispose();
         System.Drawing.Image img = System.Drawing.Image.FromFile(desfilename);
         System.Drawing.Image bmp = new System.Drawing.Bitmap(img);
         img.Dispose();
         this.pictureBoxDocument.Image = bmp;
     }
     else
     {
         MessageBox.Show("取消");
     }
 }
 private void button9_Click(object sender, EventArgs e)
 {
     String PathAddition;
     if (!this.ScanDateFolderNameFormat.Equals(""))
     {
         PathAddition = DateTime.Now.ToString(this.ScanDateFolderNameFormat) + "/";
     }
     else
     {
         PathAddition = "";
     }
     ScanWait ScanWaitWindow = new ScanWait(this.scanPath + PathAddition);
     if (ScanWaitWindow.ShowDialog() == DialogResult.OK)
     {
         Thread.Sleep(this.ScanDelayTime);
         MessageBox.Show("搜索到的路径:" + ScanWaitWindow.ImageFilePath);
         Image DocumentImage = Image.FromFile(ScanWaitWindow.ImageFilePath);
         Image MemImage = new Bitmap(DocumentImage);
         DocumentImage.Dispose();
         if (this.pictureBox1.Image != null)
             this.pictureBox1.Image.Dispose();
         this.pictureBox1.Image = MemImage;
     }
     else
     {
         MessageBox.Show("取消");
     }
 }
        private void button8_Click(object sender, EventArgs e)
        {
            if (this.PatientDataView.CurrentRow == null)
            {
                MessageBox.Show("请选择一位病人");
                return;
            }
            String PathAddition;
            if (!this.ScanDateFolderNameFormat.Equals(""))
            {
                PathAddition = DateTime.Now.ToString(this.ScanDateFolderNameFormat) + "/";
            }
            else
            {
                PathAddition = "";
            }
            ScanWait ScanWaitWindow = new ScanWait(this.scanPath + PathAddition);
            if (ScanWaitWindow.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(this.ScanDelayTime);
                MessageBox.Show("搜索到的路径:" + ScanWaitWindow.ImageFilePath);
                String desfilename;
                if (this.tabControlImage.SelectedIndex == 0)
                {
                    desfilename = this.pPath + this.PatientDataView.CurrentRow.Cells["姓名"].Value + "-" + this.PatientDataView.CurrentRow.Cells["病案号"].Value + "-1.jpg";

                }
                else
                {
                    desfilename = this.pPath + this.PatientDataView.CurrentRow.Cells["姓名"].Value + "-" + this.PatientDataView.CurrentRow.Cells["病案号"].Value + ".jpg";
                }
                Image DocumentImage = Image.FromFile(ScanWaitWindow.ImageFilePath);
                DocumentImage.Save(desfilename, System.Drawing.Imaging.ImageFormat.Jpeg);
                DocumentImage.Dispose();
                System.Drawing.Image img = System.Drawing.Image.FromFile(desfilename);
                System.Drawing.Image bmp = new System.Drawing.Bitmap(img);
                img.Dispose();
                if (this.tabControlImage.SelectedIndex == 0)
                {
                    if (pictureBox2.Image != null)
                        pictureBox2.Image.Dispose();
                    pictureBox2.Image = bmp;
                    MessageBox.Show("pictureBox2");
                }
                else
                {
                    if (pictureBoxDocument.Image != null)
                        pictureBoxDocument.Image.Dispose();
                    pictureBoxDocument.Image = bmp;
                    MessageBox.Show("pictureBoxDocument");
                }
            }
            else
            {
                MessageBox.Show("取消");
            }
            //刷新
            PatientDataView_SelectionChanged(null,null);
        }
 public ScanImage(ScanWait ParentWindow)
 {
     this.ParentWindow = ParentWindow;
 }
 public ScanImage(ScanWait ParentWindow)
 {
     this.ParentWindow = ParentWindow;
 }
Esempio n. 8
0
        private void button8_Click(object sender, EventArgs e)
        {
            if (this.PatientDataView.CurrentRow == null)
            {
                MessageBox.Show("请选择一位病人");
                return;
            }
            String PathAddition;

            if (!this.ScanDateFolderNameFormat.Equals(""))
            {
                PathAddition = DateTime.Now.ToString(this.ScanDateFolderNameFormat) + "/";
            }
            else
            {
                PathAddition = "";
            }
            ScanWait ScanWaitWindow = new ScanWait(this.scanPath + PathAddition);

            if (ScanWaitWindow.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(this.ScanDelayTime);
                MessageBox.Show("搜索到的路径:" + ScanWaitWindow.ImageFilePath);
                String desfilename;
                if (this.tabControlImage.SelectedIndex == 0)
                {
                    desfilename = this.pPath + this.PatientDataView.CurrentRow.Cells["姓名"].Value + "-" + this.PatientDataView.CurrentRow.Cells["病案号"].Value + "-1.jpg";
                }
                else
                {
                    desfilename = this.pPath + this.PatientDataView.CurrentRow.Cells["姓名"].Value + "-" + this.PatientDataView.CurrentRow.Cells["病案号"].Value + ".jpg";
                }
                Image DocumentImage = Image.FromFile(ScanWaitWindow.ImageFilePath);
                DocumentImage.Save(desfilename, System.Drawing.Imaging.ImageFormat.Jpeg);
                DocumentImage.Dispose();
                System.Drawing.Image img = System.Drawing.Image.FromFile(desfilename);
                System.Drawing.Image bmp = new System.Drawing.Bitmap(img);
                img.Dispose();
                if (this.tabControlImage.SelectedIndex == 0)
                {
                    if (pictureBox2.Image != null)
                    {
                        pictureBox2.Image.Dispose();
                    }
                    pictureBox2.Image = bmp;
                    MessageBox.Show("pictureBox2");
                }
                else
                {
                    if (pictureBoxDocument.Image != null)
                    {
                        pictureBoxDocument.Image.Dispose();
                    }
                    pictureBoxDocument.Image = bmp;
                    MessageBox.Show("pictureBoxDocument");
                }
            }
            else
            {
                MessageBox.Show("取消");
            }
            //刷新
            PatientDataView_SelectionChanged(null, null);
        }