Android Bitmap Save saveBitmapFromView(View view, String path)

Here you can find the source of saveBitmapFromView(View view, String path)

Description

save Bitmap From View

Declaration

public static void saveBitmapFromView(View view, String path) 

Method Source Code

//package com.java2s;
import java.io.FileOutputStream;

import android.graphics.Bitmap;

import android.view.View;

public class Main {
    public static void saveBitmapFromView(View view, String path) {
        if (view != null) {
            Bitmap bitmap = view.getDrawingCache();

            try {
                FileOutputStream fos = new FileOutputStream(path);
                bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
            } catch (Exception e) {
                e.printStackTrace();//w  w w  . j  a  va  2  s .c om
            }
        }
    }
}

Related

  1. saveBitmap(Bitmap bmp, String path, CompressFormat format)
  2. saveBitmap(Bitmap image)
  3. saveBitmap(File file, Bitmap bitmap)
  4. saveBitmap(File saveToFile, Bitmap bitmapToSave)
  5. saveBitmapAsJpgAtSd(Bitmap mBitmap, String dirPath, String fileName)
  6. saveBitmapJPEGWithBackgroundColor( String strFileName, Bitmap bitmap, int nQuality, int nBackgroundColor)
  7. saveBitmapPNGWithBackgroundColor( String strFileName, Bitmap bitmap, int nBackgroundColor)
  8. saveBitmapToPath(Context ctxt, String path, String filename, Bitmap bm)
  9. saveJPEGBitmap(Bitmap bmp, String path)