Android max image/texture resolution

2019-09-17 08:29发布

问题:

I did a quick google search, but I couldn't find the max image/texture resolution for android. I currently have an image that is crashing , but when I lower the resolution it works. I dont want to just trial and error the resolutions to see if it works, some solid numbers showing limitations would be ideal.

A link to the android documentation would be fine as well. I personally don't find it intuitive.

回答1:

If it fails at a high resolution but works with a lower resolution, it sounds to me like you might be hitting a memory limit.

Have a look at this post on Image memory cost

1200 dpi - 7200x4800  (34,560,000 pixels)  - 103,680,000 bytes (99 MB)
2400 dpi - 14400x9600 (138,240,000 pixels) - 414,720,000 bytes (396 MB)

If you are pushing into the range of 130 million pixels, you are well over on your (fair) memory consumption, at least on most of today's mobile hardware.

UPDATE

Here is another post discussing issues related to photos and memory