title: Check the width and height of an image
body: <p>I am able to display the picture in the picture box without checking the file size by the following code:</p>
  
  <pre><code>private void button3_Click_1(object sender, EventArgs e)
  {
      try
      {
          //Getting The Image From The System
          OpenFileDialog open = new OpenFileDialog();
          open.Filter =
            "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
  
          if (open.ShowDialog() == DialogResult.OK)
          {
              Bitmap img = new Bitmap(open.FileName);
  
              pictureBox2.Image = img;
          }
      }
      catch (Exception)
      {
          throw new ApplicationException("Failed loading image");
      }
  }
  </code></pre>
  
  <p>I want to check the image size for example whether it is <strong>2MB or 4MB</strong> before displaying in the picture box. i also want to check the <strong>width</strong> and <strong>height</strong> of the image.</p>