Sagar...
Sagar...

Reputation: 1062

Can we use higher resolution images in UIImageView?

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 comes 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

Upvotes: 2

Views: 447

Answers (2)

jv42
jv42

Reputation: 8593

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.

Upvotes: 1

skorulis
skorulis

Reputation: 4381

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.

Upvotes: 0

Related Questions