Custom ImageView Automatically Changes to Nexus 7

I have a custom ImageView that spans the entire screen. The image is obtained from one of the available folders, drawable-hdpi, drawable-xhdpi, drawable-sw600dp, etc., And for each density container there are separate images.

While the application works fine on xhdpi and hdpi devices, the problem occurs when I test it on the Nexus 7. The image stored in the sw600dp folder is 1600x1600 and should be sufficient for direct drawing on the screen (without scaling), however, when I run application, the screen is completely blank, and I get the following warning:

03-04 16: 25: 46.338: W / OpenGLRenderer (25457): the bitmap is too large to be loaded into the texture (2130x2130, max = 2048x2048)

For some reason, the 1600x1600 bitmap is scaled to 2130x2130, although I didn't manually scale it anywhere (without using the postcale matrix or scaleX / scaleY)

Any thoughts on why this might happen? Please provide a solution and also explain why this could happen.

+5
source share
2 answers

Since the Nexus 7 is tvdpi, it scales each image to 1.33 from the original value. Thus, 1600 becomes (1600 * 1.33) = ~ 2130. It will not display it from the sw600dp folder.

Additional information: http://developer.android.com/guide/practices/screens_support.html

, 7- ( 1024 * 600).

+7

, .

Romain Guy (Android framework engineer):

. , OpenGL . Xoom (2048x2048.) .

SO : 1, 2

Git:

: , (- ) , , 1600x1600 2130x2130!

0

All Articles