Search code examples
iphoneobjective-ctransformcgaffinetransformimage-rotation

image coming blurred and screwed after applying rotation on image view


I am stuck with a strange problem that, I have a image view which has to shown at some angle approx 5 degree.For that I rotate my UIImageView to 5 degree but the image in UIImageView not coming proper as it was before transformation.

For more understanding see images

image before rotation image after rotation

You can see the second image is looking like clipped from corners and looks some blur also.

My code for rotation:-

myimageView.transform = CGAffineTransformMakeRotation(radians(5));

Please suggest me how to solve this problem.

Thanks in advance.


Solution

  • Have you tried using CGContextRotateCTM(context, radians); and [sourceImage drawInRect:rect];?