I am developing an iphone application and i am using a background picture for my app. I know that before iphone 4 , the resolution of the screen was 480x320 and after 960x640. I read that i should use 2 images like : MyImage.png
and MyImage@2x.png
with the 2 different resolutions and the app will know which one to choose according to the phone. My question is very simple. If i just use the 960x480 , whats the difference? I am developing on an iphone 3gs and i am using this resolution and everything works perfect. So why have a small resolution for these phones?
我正在开发一个iphone应用程序,我正在使用我的应用程序的背景图片。我知道在iphone 4之前,屏幕的分辨率是480x320,然后是960x640。我读到我应该使用2个图像,如:MyImage.png和MyImage@2x.png,具有2种不同的分辨率,应用程序将知道根据手机选择哪一个。我的问题很简单。如果我只使用960x480,那么差异是什么?我正在开发iphone 3gs,我正在使用这个分辨率,一切都很完美。那么为什么这些手机的分辨率很小?
3 个解决方案
#1
4
The difference, in my opinion, is the following: the phone is going to resize the doubled-resolution to half the size, and this will lead to (1) the final image is not as smooth as if you would have exported it from a image application like Illustrator or Photoshop - at least from my own experience, when I export both resolutions, in non retina devices, the images don't look as good if I had exported the normal resolution. Also (2) the device will waste time/performance to make this conversion, although I don't know how much it is significant. And (3) finally, you may overload memory with no need, considering that the doubled sized images are bigger files, and you could use smaller files instead.
在我看来,差异如下:手机会将双倍分辨率的大小调整为一半大小,这将导致(1)最终图像不像你从它输出的那样平滑图像应用程序,如Illustrator或Photoshop - 至少根据我自己的经验,当我导出两种分辨率时,在非视网膜设备中,如果我导出了正常的分辨率,图像看起来不太好。此外(2)该设备将浪费时间/性能来进行此转换,但我不知道它有多重要。并且(3)最后,你可以毫无需要地重载内存,考虑到双倍大小的图像是更大的文件,你可以使用更小的文件。
If you don't mind about this issues, you can go ahead. Try yourself.
如果你不介意这个问题,你可以继续。试试自己。
#2
2
If nothing else, the high-resolution images will tax the memory much more. One full-screen image at 320✕480 is around 600K in memory, whereas the 640✕960 is almost 2.5M, four times as much. On the older devices the memory is much more scarce than on the new ones and you might run into problems later in the development cycle, when there are more resources in play.
如果不出意外,高分辨率图像会对内存产生更大的影响。 320✕480的一个全屏图像在内存中大约为600K,而640✕960几乎是2.5M,是原来的四倍。在较旧的设备上,内存比新设备更加稀缺,并且在开发周期的后期,当有更多资源在运行时,您可能会遇到问题。
Even if you are able to test the app on all older supported devices and you can guarantee that there are no immediate performance problems or visual glitches, the app will take more memory, forcing the OS to kill other apps more frequently (= worse overall user experience).
即使您能够在所有旧版支持的设备上测试应用程序,并且您可以保证没有即时性能问题或视觉故障,该应用程序将占用更多内存,迫使操作系统更频繁地杀死其他应用程序(=更糟糕的整体用户经验)。
#3
1
if you use one version of image, (960x640) , there will be a memory overhead when the app run on non-retina. you dont need to display the high res in non-retina, only in retina display, making two versions of images .png and @2x.png will tell ios which image version it should load, depends on what device is currently in use.
如果你使用一个版本的图像,(960x640),当应用程序在非视网膜上运行时会有内存开销。您不需要在非视网膜上显示高分辨率,仅在视网膜显示中,制作两个版本的图像.png和@ 2x.png将告诉ios它应该加载哪个图像版本,取决于当前使用的设备。
#1
4
The difference, in my opinion, is the following: the phone is going to resize the doubled-resolution to half the size, and this will lead to (1) the final image is not as smooth as if you would have exported it from a image application like Illustrator or Photoshop - at least from my own experience, when I export both resolutions, in non retina devices, the images don't look as good if I had exported the normal resolution. Also (2) the device will waste time/performance to make this conversion, although I don't know how much it is significant. And (3) finally, you may overload memory with no need, considering that the doubled sized images are bigger files, and you could use smaller files instead.
在我看来,差异如下:手机会将双倍分辨率的大小调整为一半大小,这将导致(1)最终图像不像你从它输出的那样平滑图像应用程序,如Illustrator或Photoshop - 至少根据我自己的经验,当我导出两种分辨率时,在非视网膜设备中,如果我导出了正常的分辨率,图像看起来不太好。此外(2)该设备将浪费时间/性能来进行此转换,但我不知道它有多重要。并且(3)最后,你可以毫无需要地重载内存,考虑到双倍大小的图像是更大的文件,你可以使用更小的文件。
If you don't mind about this issues, you can go ahead. Try yourself.
如果你不介意这个问题,你可以继续。试试自己。
#2
2
If nothing else, the high-resolution images will tax the memory much more. One full-screen image at 320✕480 is around 600K in memory, whereas the 640✕960 is almost 2.5M, four times as much. On the older devices the memory is much more scarce than on the new ones and you might run into problems later in the development cycle, when there are more resources in play.
如果不出意外,高分辨率图像会对内存产生更大的影响。 320✕480的一个全屏图像在内存中大约为600K,而640✕960几乎是2.5M,是原来的四倍。在较旧的设备上,内存比新设备更加稀缺,并且在开发周期的后期,当有更多资源在运行时,您可能会遇到问题。
Even if you are able to test the app on all older supported devices and you can guarantee that there are no immediate performance problems or visual glitches, the app will take more memory, forcing the OS to kill other apps more frequently (= worse overall user experience).
即使您能够在所有旧版支持的设备上测试应用程序,并且您可以保证没有即时性能问题或视觉故障,该应用程序将占用更多内存,迫使操作系统更频繁地杀死其他应用程序(=更糟糕的整体用户经验)。
#3
1
if you use one version of image, (960x640) , there will be a memory overhead when the app run on non-retina. you dont need to display the high res in non-retina, only in retina display, making two versions of images .png and @2x.png will tell ios which image version it should load, depends on what device is currently in use.
如果你使用一个版本的图像,(960x640),当应用程序在非视网膜上运行时会有内存开销。您不需要在非视网膜上显示高分辨率,仅在视网膜显示中,制作两个版本的图像.png和@ 2x.png将告诉ios它应该加载哪个图像版本,取决于当前使用的设备。