Android: How to make merge multiple bitmap images to a large jpeg image -


i going merge multiple bitmap images jpeg image.

i can make large .bmp file multiple bitmap images(tiled). , can convert jpeg file jpeg library.

but speed of process slow. tested on samsung phone.

it takes 15 secs make large bitmap tiled bmp images. there way solve this?

thanks.

the problem image manipulation if don't correctly end copying entire image several times. challenge try keep 1 buffer image. following pretty efficient.

// create 1 big bitmap bitmap finalbitmap = bitmap.create(finalwidht, finalheight, bitmap.config.argb_8888);  for(int i=0;i<numtileswide;i++) {     for(int j=0;j<numtileshigh;j++) {         int[] tilepixels = // load tile bitmap int array         // copy tile onto final bitmap         finalbitmap.setpixels(tilepixels, 0, tilewidth, i*tilewidth, j*tileheight);      } } // write image jpeg file finalbitmap.compress(bitmap.compressformat.jpeg, 50, /* file stream */);  

Comments