I have been able to get the behavior I want using Xcode and the Attributes Inspector. I have also found a lot of really good information here on stackoverflow. The problem I cannot resolve is that cropping an image in code uses pixels but the rect I have is in points. Help!
This is what I am trying to do: I have an image that is full size on the iPhone. I want to capture a portion of the center of the image. But I want that portion to be the size of my rectangle.
In Xcode, I created a view with a uiimageview with the uiimageview view mode = center and Clip Subviews checked. Then, in code I set the image. Voila! My image is cropped at the center and displayed in the rectangular shaped view.
Can someone please help me do this in code? I've been trying different approaches for days....feeling pretty dumb by now.
Thank you in advance for your help.