title: How do I display a scanned Image automatically in a Picturebox?
body: <p>I need upload image into <code>PictureBox</code> automatically after scan.</p>
  
  <p>This is PictureBox's name <code>PictureBox ptbImgDocEmp</code></p>
  
  <p>This is the class of scanner</p>
  
  <pre><code>Scanner.cs
  
   public class Scanner
   {
      Device oDevice;
      Item oItem;
      CommonDialogClass dlg;
      public Scanner()
      {
          dlg = new CommonDialogClass();
          try
          {
              oDevice = dlg.ShowSelectDevice(WiaDeviceType.ScannerDeviceType, true, false);
          }
  
          catch (Exception Exp)
          { MessageBox.Show("printer not detected");}
  
      }
  </code></pre>
  
  <p>This is a Scanner Button</p>
  
  <pre><code>private void btnSca_Click(object sender, EventArgs e)
      {
          Scanner oScanner = new Scanner();
          oScanner.Scann();
  
          SaveFileDialog saveFileDialog = new SaveFileDialog();
          saveFileDialog.FileName = "test.jpg";
          saveFileDialog.Filter = "jpg files (*.jpg)|*.jpg|All files (*.*)|*.*";
          if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
          {
              ptbImgDocEmp.Image = Image.FromFile(saveFileDialog.FileName);
              ptbImgDocEmp.Refresh();
          }
      }
  </code></pre>