Android examples for User Interface:View Bitmap
get Decoration View Bitmap
//package com.java2s; import android.app.Activity; import android.graphics.Bitmap; import android.view.View; public class Main { public static Bitmap getDecorViewBitmap(Activity activity) { View decorView = activity.getWindow().getDecorView(); return getViewBitmap(decorView); }/* w ww. ja v a2s. c o m*/ public static Bitmap getViewBitmap(View view) { view.setDrawingCacheEnabled(true); Bitmap cache = view.getDrawingCache(); if (cache == null) { return null; } Bitmap bitmap = Bitmap.createBitmap(cache); view.setDrawingCacheEnabled(false); return bitmap; } }