如何扩大UIImage而不平滑任何东西? [英] How to scale up an UIImage without smoothening anything?

查看:118
本文介绍了如何扩大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天全站免登陆