在图像视图上应用旋转后,图像变得模糊和扭曲
我遇到了一个奇怪的问题, 我有一个图像视图,必须以大约 5 度的某个角度显示。为此,我将 UIImageView
旋转到 5 度,但 UIImageView
中的图像未按原样正确显示转型前。
如需更多了解,请参阅图像
您可以看到第二张图像看起来像是从角落剪掉的,而且看起来也有些模糊。
我的轮换代码:-
myimageView.transform = CGAffineTransformMakeRotation(radians(5));
请建议我如何解决这个问题。
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来这个类似的 SO Q&A 中有几个解决方案:
任何快速而肮脏的抗锯齿技术旋转的 UIImageView?
如果实际上只是锯齿状的边缘,请尝试在图像内容周围添加 1px 透明边框(这是上面链接中的建议)。
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).
您是否尝试过使用
CGContextRotateCTM(context, radians);
和[sourceImage drawInRect:rect];
?Have you tried using
CGContextRotateCTM(context, radians);
and[sourceImage drawInRect:rect];
?