title: Resizing a bitmap to a fixed value but without changing the aspect ratio
body: <p>I'm looking for a solution for the following problem: how to change the size of a <code>Bitmap</code>to a fixed size (for example 512x128). The aspect ratio of the bitmap content must be preserved.</p>
  
  <p>I think it should be something like this:</p>
  
  <ul>
  <li><p>create an empty 512x128 bitmap</p></li>
  <li><p>scale the original bitmap down to fit the 512x128 pixels with keeping the aspect ratio</p></li>
  <li><p>copy the scaled into the empty bitmap (centered)</p></li>
  </ul>
  
  <p>What is the simplest way to achieve this?</p>
  
  <p>The reason for all this is, that the <code>GridView</code> messes the layout up when the aspect ratio of an image differs from the other. Here is a screenshot (all images except the last one have the aspect ratio of 4:1):</p>
  
  <p><a href="http://www.thkusch.de/gridview.png" rel="noreferrer">screenshot</a></p>