Here you can find the source of saveBitmapFromView(View view, String path)
public static void saveBitmapFromView(View view, String path)
//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 } } } }