开发者

Can we use higher resolution images in UIImageView?

开发者 https://www.devze.com 2023-01-18 05:45 出处:网络
Is it possible to use higher resolution images as it is i.e 1800 *1200. After checking with instrument come to know. image unpacking is done by [ width * height * 4 ] and in this case it takes 8 MB.

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

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

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

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

Because of this following things co开发者_如何转开发mes in focus

  1. You cann't use higher resolution images.
  2. If you want to use higher resolution images , then need to scale it down.

Thanks,

Sagar


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.


You can if cut the images up into tiles. Since it isn't possible to display the entire 1800*1200 image at once you can just display the bits that are actually visible and cache the rest to disk. This is similar to how Google maps works.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号