我们可以在UIImageView中使用更高分辨率的图像吗? [英] Can we use higher resolution images in UIImageView?

查看:47
本文介绍了我们可以在UIImageView中使用更高分辨率的图像吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用分辨率更高的图像,例如1800 * 1200.

Is it possible to use higher resolution images as it is i.e 1800 *1200.

在检查仪器后才知道.图像解压缩是通过[width * height * 4]完成的,在这种情况下,它需要8 MB.

After checking with instrument come to know. image unpacking is done by [ width * height * 4 ] and in this case it takes 8 MB.

当我们有两个UIImageViews并且都持有1800 * 1200 res的UIImages时,问题就出现了.

Problem comes when we have two UIImageViews and both are holding UIImages with 1800 * 1200 res.

很明显,应用程序将由于内存不足而崩溃.UIImageView/UIImage的默认行为是什么

it is clear application will crash due to low memory. is this default behavior of UIImageView / UIImage

由于以下原因,因此成为重点

Because of this following things comes in focus

  1. 您不能使用更高分辨率的图像.
  2. 如果要使用分辨率更高的图像,则需要按比例缩小图像.

谢谢

Sagar

推荐答案

Apple的参考库中有一个名为PhotoScroller的示例.它提供了一种以块(平铺)形式显示大图像的方法.那应该做你想要的.

There is a sample called PhotoScroller in Apple's Reference Library. It provides a way to display big images in chunks (tiles). That should do what you want.

这篇关于我们可以在UIImageView中使用更高分辨率的图像吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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