It looks like what you are trying to do is pin the image to the right, leaving the top, left and bottom the same.
Two attempts:
1) Subclass UIView and in the drawRect method adjust the rectangle and pull out the cropped image using CGContextDrawImage (context, rect, sourceImage.CGImage) .
2) Use CALayers. You can customize the "contentRect" of the imageView layer:
CALayer* imageLayer = imageView.layer; imageLayer.masksToBounds = YES; CGRect rect; if (inPortrait) rect = CGRectMake(0.0, 0.0, 0.5, 1.0);
This reduces the image in half in width. masksToBounds takes care of clipping sublayers (if any). You can customize the contentsRect device rectangle to customize where you want to crop. You can also adjust your own imageView frames to fit your size.
This added bonus is that the contentRect setting is automatically animated, so when you do the rotation, the width of the animation is in and in good condition.
Ramin
source share