【问题标题】:When I rotate an UIImageView with the transform property, the edges pixellate [duplicate]当我使用变换属性旋转 UIImageView 时,边缘像素化 [重复]
【发布时间】:2011-08-16 14:58:52
【问题描述】:

可能重复:
How to do antialiasing on a rotated view?

我正在尝试使用这种技术旋转一些 UIImageViews:

imageView.transform = CGAffineTransformMakeRotation(r);

其中 r 是通常介于 -0.3 和 0.3 之间的浮点数。

问题在于旋转的图像(源自方形 jpeg)具有锯齿状边缘(像素化),因为它们在变换后处于某个角度。有没有办法解决这个问题,使边缘平滑(即抗锯齿)?

【问题讨论】:

  • 抗锯齿 - 或尽可能使用矢量图
  • 在这种情况下我不能使用矢量图。如何应用抗锯齿?
  • 我也想知道 :) - 你能编辑你的问题,让它提到 AA 吗?

标签: ios uiimageview


【解决方案1】:

您可以在 Info.plist 中设置一个启用边缘抗锯齿功能的键:UIViewEdgeAntialiasing。

http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

【讨论】:

  • 太棒了..在您的 info.plist 集中:“使用边缘抗锯齿渲染”是的
  • 是的,它在图层中效果很好,但我发现视图的子视图仍然有抗锯齿
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-02
相关资源
最近更新 更多