如何在不平滑任何东西的情况下放大 UIImage? [英] How to scale up an UIImage without smoothening anything?

查看:13
本文介绍了如何在不平滑任何东西的情况下放大 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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