By default, UIImageView displays his image as 1px of image = 1pt in UIImageView, but I’d like to display as 2px of image = 1pt.
Version of saving image with name “..@2x..” is not suitable, images are not saving in file system.
For example, image size is 400×100, I want to display the image on center of display, and it should be 120 pt on the left and 120 pt on the right of the image(640-400) / 2
That’s quite easy, note that for the versions below iOS 4 you don’t have Retina displays, that’s why in the image scaling method i’m doing this check first:
and then having
imageloaded from somewhere (file, cache, etc.) i’m scaling it this wayThe method
is available at iOS 4.0. that’s why you need the first check. If sale is not supported, return the 1.0 scaled image.