UIImage ScaleToFit 禁用抗锯齿?

发布于 2024-11-09 06:05:59 字数 118 浏览 3 评论 0原文

UIImage 中的抗锯齿缩放以适合

在缩放 uiimage 中的图像时,有什么方法可以禁用抗锯齿吗?谢谢

antialiasing in UIImage scale to fit

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘亓 2024-11-16 06:05:59

将 QuartzCore 框架添加到您的项目中,然后将图像视图的 layermagnificationFilter 属性设置为 kCAFilterNearest

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

静谧 2024-11-16 06:05:59

我在 Xcode 11 (Swift 5) 中使用 SpriteKit 也遇到了这个问题。为了解决这个问题(即禁用抗锯齿),我执行了以下操作:

texture?.filteringMode = SKTextureFilteringMode.nearest

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文