UIImage ScaleToFit disable antialias?

纵然是瞬间 提交于 2019-12-17 22:16:07

问题


is there any way to disable antialiasing when scaling images in uiimage? thanks


回答1:


Add the QuartzCore framework to your project, then set the image view’s layer’s magnificationFilter property to kCAFilterNearest.




回答2:


I was working with SpriteKit in Xcode 11 (Swift 5) and also got this problem. To solve it (i.e. disable anti-aliasing) i did the following:

texture?.filteringMode = SKTextureFilteringMode.nearest


来源:https://stackoverflow.com/questions/6092167/uiimage-scaletofit-disable-antialias

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