14

Is there any way to convert a android.graphics.Bitmap instance into jpeg in android?

Corey Scott
  • 2,430
  • 3
  • 28
  • 33
Nitish
  • 3,097
  • 13
  • 45
  • 80

1 Answers1

34

Try with compress method like:

bitmap.compress(Bitmap.CompressFormat.JPEG, quality, outStream);

Here is a sample program : compressing-a-bitmap-to-jpg-format-android-example

Imran Rana
  • 11,899
  • 7
  • 45
  • 51
  • Thanks for help Imran, i got the result. Earlier also, I tried with the above method, but I was not getting desired output. Thats why, I posted my query here. But now, I rectified my mistake and its working fine. – Nitish Jun 09 '12 at 11:38