title: Finding a percentage
body: <p>Here's the problem. I have a picture that will have a different Height every time according to the picture that's loaded.</p>
  
  <p>I'd like to scale that picture so it fits inside of the document which has 800 pixels height. So if the image has 2560px in height, I need to find out the PERCENTAGE needed to bring that pixel height down to 750 so it fits snuggly on the page.</p>
  
  <p>I'm stuck trying to find the formula for this simple enough problem.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(
      image, System.Drawing.Imaging.ImageFormat.Jpeg);
  
  if (pic.Height &gt; pic.Width)
  {
      //Maximum height is 800 pixels.
      pic.Height formula goes here....
  }
  else
  {
      //Maximum width is 600 pixels.
      pic.Width formula goes here....
  }
  </code></pre>