Reputation: 6882
I am trying to build an Android application which can take several photos taken by the camera, and merge them into one giant image. For example, I might take three photos and arrange them in a vertical stack for output as a single image. Ideally, I'd like to be able to keep the images at the original size. Unfortunately, using Bitmap.createBitmap() causes an OutOfMemoryException before even approaching the size of one photo of camera dimensions. Is this possible? Or do I just need to resort to scaling the photos before trying to merge them into a single Bitmap?
Upvotes: 2
Views: 832
Reputation: 1007659
What is your goal?
If your goal is to upload the combined image, have the server combine them, since it has a wee bit more CPU and RAM than do most Android devices.
If your goal is to display the combined image, since each piece of the combined image is going to be bigger than the screen size, treat the image pieces as tiles -- don't combine them, but draw them as needed as the user scrolls around the virtual combined image space.
Upvotes: 4