Soumen Bhuin
Soumen Bhuin

Reputation: 27

What is maximum resolution of an image that can be loaded in UIImageView in iOS Devices?

What is the maximum resolution of an UIImage that can be set in UIImageView using SetImage: method in iOS Devices?

Upvotes: 0

Views: 617

Answers (1)

rckoenes
rckoenes

Reputation: 69499

You can load any size of image in a UIImageView as long a there is memory free. But it is not the UIImageView that is taking up the memory, but the UIImage.

As Apple states the following in the UIImage documentation you should not load to big an image:

You should avoid creating UIImage objects that are greater than 1024 x 1024 in size. Besides the large amount of memory such an image would consume, you may run into problems when using the image as a texture in OpenGL ES or when drawing the image to a view or layer. This size restriction does not apply if you are performing code-based manipulations, such as resizing an image larger than 1024 x 1024 pixels by drawing it to a bitmap-backed graphics context. In fact, you may need to resize an image in this manner (or break it into several smaller images) in order to draw it to one of your views.

Upvotes: 2

Related Questions