Compress Image in android

Shah picture Shah · Jun 24, 2011 · Viewed 17k times · Source

I am making an application which takes image from the camera and then email it.

Friends since you know that images from camera may be of too much resolution and in size as well e.g. 2.0MB and more so what i want is to re-size the image in size as well as in resolution so that i could attach that file to the email.

So can anybody give me some code sample or some guidelines to get over my problem.

Thanks in advance

Answer

Sujit picture Sujit · Jun 24, 2011

you can do this to compress BitMap..

mBitmap = Bitmap.createScaledBitmap(mBitmap, 160, 160, true);