Android View to Image Capture shotScreen(View cv)

Here you can find the source of shotScreen(View cv)

Description

shot Screen

Declaration

public static Bitmap shotScreen(View cv) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;

import android.graphics.Canvas;

import android.view.View;

public class Main {
    public static Bitmap shotScreen(View cv) {
        try {//  www.j  a v a 2  s.c  o m
            cv.setDrawingCacheEnabled(true);
            Bitmap bmp = Bitmap.createBitmap(cv.getWidth(), cv.getHeight(),
                    Config.ARGB_8888);
            Canvas canvas = new Canvas(bmp);
            cv.draw(canvas);
            cv.setDrawingCacheEnabled(false);
            return bmp;
        } catch (Exception e) {
            return null;
        }
    }
}

Related

  1. captureWebViewVisibleSize(WebView webView)
  2. convertViewToBitmap(View view)
  3. getBitmapFromView(View view)
  4. printScreen(View v)
  5. printScreen(View v, int quality)
  6. view2Bitmap(View view)
  7. view2Bitmap(View view, boolean cache)
  8. loadBitmapFromView(View v)
  9. getBitmapFromView()