旋转图像时图像上的锯齿状边缘 [英] Jagged edges on images when rotating them

查看:167
本文介绍了旋转图像时图像上的锯齿状边缘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个黑色背景的方形白色图像。当我旋转图像时,边缘变得非常锯齿状。它真的不好看。是否有任何设置可以让手机在操作图像时使图像平滑?或者是唯一真正的选择,要求艺术家使用一些艺术家的技术,如抗锯齿(不知道这是正确的术语)还是什么?我在文档中看到了minificationFilter用于缩放...也许有类似的东西可能适合我的问题,我还没有在文档中找到。任何提示家伙?

I have an square white image against a black back ground. When i rotate the image the edges become very jagged. Its really doesn't look good. Are there any settings that you can use to get the phone to smoothen out the image when it manipulates it? Or is the only real option to ask the artist to use some artist technique like anti aliasing(dont know if thats the correct term) or something? I've seen minificationFilter in the docs for scaling.. maybe there is something like this that might be appropriate for my problem that I haven't found in the docs yet. Any hints guys?

非常感谢,
-Code

Many Thanks, -Code

推荐答案

如果你没有手持iOS 4 / openGL,那么黑客也可以运行。在所有图像周围留下1px透明边框 - 透明边框呈锯齿状,但你无法分辨,因为它是透明的。图像内部应该看起来很光滑:)

If you don't have iOS 4 / openGL to hand, there's a hack that works almost as well. Leave a 1px transparent border around all youur images - the transparent border is jagged but you can't tell because it's transparent. The inside of the image should look smooth :)

虽然很明显,只有您可以访问原始图像时才能轻松实现。否则你必须加载图像,将其渲染到带边框的图形上下文中并使用新图像:(如果你有设计师的原件/访问权限,只需告诉他/她添加1px透明边框,你当前的代码应该'只是工作'

Though obviously this only works easily if you have access to the original images. Otherwise you have to load the image, render it into a graphics context with the border and use the new image :( If you have the originals / access to the designer, just tell him/her to add 1px transparent border and your current code should 'just work'

这篇关于旋转图像时图像上的锯齿状边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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