title: How to scan an image and save it with normal size in c#
body: <p>I want to scan a page and save it automatically. This code works well but the problem is an image that creates and then it saves is too big! it creates an image with the size of 30Mb!
  How can I change this code to save an image with normal size?
  Here is my code:<br>
  Thanks.</p>
  
  <pre><code>        private void button7_Click(object sender, EventArgs e)
      {
          try
          {
              var deviceManager = new DeviceManager();
  
              for (int i = 1; i &lt;= deviceManager.DeviceInfos.Count; i++) // Loop Through the get List Of Devices.
              {
                  if (deviceManager.DeviceInfos[i].Type != WiaDeviceType.ScannerDeviceType) // Skip device If it is not a scanner
                  {
                      continue;
                  }
                  lstListOfScanner.Items.Add(deviceManager.DeviceInfos[i].Properties["Name"].get_Value());
              }
          }
          catch (COMException ex)
          {
              MessageBox.Show(ex.Message);
          }
  
          try
          {
              var deviceManager = new DeviceManager();
  
              DeviceInfo AvailableScanner = null;
  
              for (int i = 1; i &lt;= deviceManager.DeviceInfos.Count; i++) // Loop Through the get List Of Devices.
              {
                  if (deviceManager.DeviceInfos[i].Type != WiaDeviceType.ScannerDeviceType) // Skip device If it is not a scanner
                  {
                      continue;
                  }
  
                  AvailableScanner = deviceManager.DeviceInfos[i];
  
                  break;
              }
              var device = AvailableScanner.Connect(); //Connect to the available scanner.
              var ScanerItem = device.Items[1]; // select the scanner.
  
              var imgFile = (ImageFile)ScanerItem.Transfer(FormatID.wiaFormatJPEG); //Retrive an image in Jpg format and store it into a variable.
              var Path = @"C:\....\ScanImg.jpg"; // save the image in some path with filename.
              if (File.Exists(Path))
              {
                  File.Delete(Path);
              }
              imgFile.SaveFile(Path);
            }
          catch (COMException ex)
          {
              MessageBox.Show(ex.Message);
          }
          /////////////////////////////////////
      }
  </code></pre>