问题
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
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.
回答1:
Have you tried using CGContextRotateCTM(context, radians);
and [sourceImage drawInRect:rect];
?
回答2:
Looks like there are several solutions located in this similar SO Q&A: Any quick and dirty anti-aliasing techniques for a rotated UIImageView?
If it is, in fact, just the edges that are jagged, try adding a 1px transparent border around in image content (this is a suggestion in the above link).
来源:https://stackoverflow.com/questions/8999483/image-coming-blurred-and-screwed-after-applying-rotation-on-image-view