2

When I trying to render a bitmap in imageview

mImageView.setImageBitmap(mBitmap);

I would see Bitmap too large to be uploaded into a texture in log.

Ok, I know there is limit on OpenGl that would throw this warning message.
But can I know whether the image is rendered success or not?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Bear
  • 5,138
  • 5
  • 50
  • 80

2 Answers2

1

You should check maximum texture size by getting value of GL_MAX_TEXTURE_SIZE environment value.

You can review this value for various Android devices on site of GLBEnchmark: http://www.glbenchmark.com/phonedetails.jsp?benchmark=glpro25&D=Google+Nexus+S&testgroup=gl

To reduce video memory footprint you may want to use ETC1 textures. If you use OpenGL ES 2.0 you can use it straight away (ETC1 is part of GL ES 2.0 specs), if you use OpenGL 1.1 you should check for ETC1 support by looking in list of GL extensions.

keaukraine
  • 5,315
  • 29
  • 54
  • actually, I know this. But to get this value, I must create a SurfaceView to do so. It seems it is not work to do so.. – Bear Nov 03 '12 at 03:28
0

Probably not other than the pretty obvious "Is it on the screen?" answer. Just don't go crazy and you should be fine. You can do things like crop or resize a copy of the image to reduce the RAM footprint. I never tried this with a huge image, but Android usually does things like crash or slow down.

Joe Plante
  • 6,308
  • 2
  • 30
  • 23