Android Utililty Methods Bitmap Save

List of utility methods to do Bitmap Save

Description

The list of methods to do Bitmap Save are organized into topic(s).

Method

booleansaveJPEGBitmap(Bitmap bmp, String path)
save JPEG Bitmap
return saveBitmap(bmp, path, Bitmap.CompressFormat.JPEG);
voidsaveJpegFile(String fileName, Bitmap bitmap)
save Jpeg File
File file = new File(extStorageDirectory, fileName + ".jpg");
File fileDirectory = new File(extStorageDirectory);
if (!fileDirectory.exists()) {
    fileDirectory.mkdir();
OutputStream outStream = null;
try {
    outStream = new FileOutputStream(file);
...
booleansavePNGBitmap(Bitmap bmp, String path)
save PNG Bitmap
return saveBitmap(bmp, path, Bitmap.CompressFormat.PNG);
booleanstoreBitmapToFile(Bitmap bitmap, String filePath)
store Bitmap To File
if (Environment.getExternalStorageState().equals(
        Environment.MEDIA_MOUNTED)) {
    try {
        BufferedOutputStream bos = new BufferedOutputStream(
                new FileOutputStream(filePath));
        bitmap.compress(CompressFormat.PNG, 50, bos);
        bos.flush();
        bos.close();
...
voidwriteToFile(Bitmap bitmap, String filePath, int quality)
write To File
File f = new File(filePath);
FileOutputStream fOut = null;
try {
    f.createNewFile();
    fOut = new FileOutputStream(f);
    bitmap.compress(Bitmap.CompressFormat.JPEG, quality, fOut);
    fOut.flush();
    fOut.close();
...