UIImageView renders image differently to original

我的未来我决定 提交于 2019-12-11 07:05:02

问题


The image on the right is the one that I produced in photoshop. I then stripped all text and put it in an image view, as soon as I did that there was a change in colour and the vertical line lost it sharpness. Has anyone else run into a similar problem? What do I do? alt text http://grab.by/1DuZ


回答1:


Are the dimensions correct? Is the position of the image an integer? If these cases antialiasing will slightly blur your image.




回答2:


One thing to be careful of is that if your image is an odd number of pixels in either dimension then centering it onscreen will cause it to be misaligned. Imagine if you had a 1x1 image (just one pixel) and tried to center it perfectly onscreen. It can't be done because the screen is an even number of pixels wide and high. This is why it's best to always use even dimensioned images whenever possible.



来源:https://stackoverflow.com/questions/2034016/uiimageview-renders-image-differently-to-original

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!