image coming blurred and screwed after applying rotation on image view

拥有回忆 提交于 2020-02-02 13:32:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!