This is what i am doing can u please guide me as to what should be
corrected here,

On opening the file,

mBitmap = BitmapFactory.decodeStream(concontentresolver.openInputStream
(uri));
//to create a mutable bitmap out of it
mBitmap = Bitmap.createScaledBitmap(mBitmap,mBitmap.getwidth
(),mBitmap.getHeight(), true);
//also tried, for making the bitmap mutable
//mBitmap =mBitmap.copy(Config.ARGB_8888, true);

After i make changes to the bitmap i try to save it by,

OutputStream out = getContentResolver().openOutputStream(file);
if (type.equalsIgnoreCase("image/jpeg")) {
        mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
} else {
        mBitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
}
out.flush();
out.close();

But what i can see is that when i save it in a jpeg format there is a
loss in quality, and when i open a jpeg file for 3-4 time and save it,
the image is totally blurred. And the size of the
jpeg image file increases each time i save the image.
When i save it using Bitmap.CompressFormat.PNG the image is saved
properly, please guide me.

Is there any process that i have to do while opening a jpeg file and
writing it to a bitmap?

Regards,
R.Karthik
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to