How to scale up an UIImage without smoothening anything?(如何在不平滑任何东西的情况下放大 UIImage?)
问题描述
我想以这样一种方式放大 UIImage,使用户可以非常清晰地看到 UIImage 中的像素.当我把它放到 UIImageView 上并放大变换矩阵时,UIImage 会出现抗锯齿和平滑.
I want to scale up an UIImage in such a way, that the user can see the pixels in the UIImage very sharp. When I put that to an UIImageView and scale the transform matrix up, the UIImage appears antialiased and smoothed.
有没有一种方法可以通过简单地重复每一行和每一列来获得更大的像素,从而在更大的位图上下文中进行渲染?我怎么能这样做?
Is there a way to render in a bigger bitmap context by simply repeating every row and every column to get bigger pixels? How could I do that?
推荐答案
#import <QuartzCore/CALayer.h>
view.layer.magnificationFilter = kCAFilterNearest
这篇关于如何在不平滑任何东西的情况下放大 UIImage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在不平滑任何东西的情况下放大 UIImage?


- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- android 4中的android RadioButton问题 2022-01-01