【问题标题】:image coming blurred and screwed after applying rotation on image view在图像视图上应用旋转后图像变得模糊和扭曲
【发布时间】:2012-01-25 08:05:57
【问题描述】:

我遇到了一个奇怪的问题, 我有一个图像视图,它必须以大约 5 度的某个角度显示。为此,我将 UIImageView 旋转到 5 度,但 UIImageView 中的图像不像转换前那样正确。

更多理解请看图片

您可以看到第二张图片看起来像是从角落剪下来的,而且看起来也有些模糊。

我的轮换代码:-

myimageView.transform = CGAffineTransformMakeRotation(radians(5));

请建议我如何解决这个问题。

提前致谢。

【问题讨论】:

    标签: iphone objective-c transform cgaffinetransform image-rotation


    【解决方案1】:

    看起来在这个类似的 SO Q&A 中有几个解决方案: Any quick and dirty anti-aliasing techniques for a rotated UIImageView?

    如果实际上只是边缘呈锯齿状,请尝试在图像内容周围添加 1px 透明边框(这是上面链接中的建议)。

    【讨论】:

      【解决方案2】:

      您是否尝试过使用CGContextRotateCTM(context, radians);[sourceImage drawInRect:rect];

      【讨论】:

      • 请详细说明,如何使用这个提示。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-19
      • 2013-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-31
      相关资源
      最近更新 更多