title: UIImage: Resize, then Crop
body: <p>I've been bashing my face into this one for literally days now and even though I feel constantly that I am right on the edge of revelation, I simply cannot achieve my goal.</p>
  
  <p>I thought, ahead of time in the conceptual phases of my design, that it would be a trivial matter to grab a image from the iPhone's camera or library, scale it down to a specified height, using a function equivalent to the <strong>Aspect Fill</strong> option of UIImageView (entirely in code), and then <strong>crop off</strong> anything that did not fit within a passed CGRect.</p>
  
  <p>Getting the original image from camera or library, was trivial. I am shocked at how difficult the other two steps have proved to be.</p>
  
  <p>The attached image shows what I am trying to achieve. Would someone please be kind enough to hold my hand? Every code example I have found so far seems to smash the image, be upside down, look like crap, draw out of bounds, or otherwise just not work correctly.</p>