Android Bitmap Save saveBitmap(Bitmap bitmap, String filename)

Here you can find the source of saveBitmap(Bitmap bitmap, String filename)

Description

save Bitmap

Declaration

public static boolean saveBitmap(Bitmap bitmap, String filename) 

Method Source Code

//package com.java2s;
import java.io.FileOutputStream;
import java.io.OutputStream;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;

public class Main {

    public static boolean saveBitmap(Bitmap bitmap, String filename) {
        if (bitmap == null)
            return false;
        try {/*from   w w  w.  j  a  va2s .co  m*/
            OutputStream out = new FileOutputStream(filename);
            ;
            bitmap.compress(CompressFormat.JPEG, 100, out);

            out.close();
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Related

  1. saveImage(String filename, Bitmap bm)
  2. saveImage(String filename, Bitmap bm, boolean landscape)
  3. saveMyBitmap(String bitName, Bitmap mBitmap)
  4. saveToLocal(Bitmap bmp, String fileName)
  5. storeImage(Context context, Bitmap image)
  6. saveBitmap2SD(Bitmap bitmap, Context context, String filePath, String fileName)
  7. addImageAsApplication(ContentResolver cr, String name, long dateTaken, String directory, String filename, Bitmap source, byte[] jpegData)
  8. saveBitmapToFile(Bitmap bitmap, String path)
  9. save(Bitmap bitmap, String fileName)