4

I'm displaying JPG/GIF/PNG in an ImageView. I've followed the following guidelines to scale large images appropriately, with the exception of using BitmapFactory.decodeStream (downloaded from a URL) instead of BitmapFactory.decodeResource:

http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

This works great for JPG and PNG, but not at all for GIFs as the GIF does not display and I get the Bitmap too large to be uploaded into a texture message.

Is there something I'm missing?

mraviator
  • 4,034
  • 9
  • 38
  • 51

1 Answers1

1

After creating Bitmap, check its dimensions and downscale yourself using Bitmap.createScaledBitmap if needed.

How to get maximal dimensions of texture is described here.

Also watch for possible artifacts as described here.

Community
  • 1
  • 1
Pointer Null
  • 39,597
  • 13
  • 90
  • 111