Android View to Image Capture captureWebView(WebView webView)

Here you can find the source of captureWebView(WebView webView)

Description

capture Web View

Declaration

public static Bitmap captureWebView(WebView webView) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.Canvas;

import android.graphics.Picture;

import android.webkit.WebView;

public class Main {
    public static Bitmap captureWebView(WebView webView) {
        Picture snapShot = webView.capturePicture();

        Bitmap bmp = Bitmap.createBitmap(snapShot.getWidth(),
                snapShot.getHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bmp);
        snapShot.draw(canvas);/*from w  w w.ja  v a2s.c  om*/

        return bmp;
    }
}

Related

  1. captureWebViewVisibleSize(WebView webView)
  2. convertViewToBitmap(View view)
  3. getBitmapFromView(View view)
  4. printScreen(View v)