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

查看:21
本文介绍了旋转 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天全站免登陆