任何快速和脏的反锯齿技术旋转UIImageView? [英] Any quick and dirty anti-aliasing techniques for a rotated UIImageView?

查看:135
本文介绍了任何快速和脏的反锯齿技术旋转UIImageView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIImageView(全框和矩形),我用CGAffineTransform旋转。 UIImageView的UIImage填充整个框架。当旋转和绘制图像时,边缘显得明显锯齿状。有什么我可以做,使它看起来更好吗?它显然不是背景消除锯齿。

I've got a UIImageView (full frame and rectangular) that i'm rotating with a CGAffineTransform. The UIImage of the UIImageView fills the entire frame. When the image is rotated and drawn the edges appear noticeably jagged. Is there anything I can do to make it look better? It's clearly not being anti-aliased with the background.

推荐答案

请记住设置适当的反别名选项:

Remember to set the appropriate anti-alias options:

CGContextSetAllowsAntialiasing(theContext, true);
CGContextSetShouldAntialias(theContext, true);

这篇关于任何快速和脏的反锯齿技术旋转UIImageView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆