Bitmap created from view too large. How to downsample a bitmap?

1

In an android application I'm working on right now, I generate an image from a view like so:

Bitmap bg = Bitmap.createBitmap(viewport.getWidth(), viewport.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bg);
viewport.draw(c);

I later proceed to process this image further, and add it as the image for an ImageView. When I do, I get this warning:

07-30 11:35:25.811: W/OpenGLRenderer(6216): Bitmap too large to be uploaded into a texture (2640x4136, max=4096x4096)

Eventually, if I do this action enough, I get the following error:

07-30 11:41:09.190: A/libc(7984): Fatal signal 11 (SIGSEGV) at 0x00000048 (code=1), thread 7984 (.atthepool.yeti)

I think I'm causing problems with native code by doing so and would like to try downsampling the existing bitmap that I create from my viewport. Any ideas as to how to do this, or how to fix the overall problem?

Thanks in advance.

android
image-processing
asked on Stack Overflow Jul 30, 2014 by sakekasi

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0