get Bitmap For Visible Region from WebView - Android User Interface

Android examples for User Interface:WebView

Description

get Bitmap For Visible Region from WebView

Demo Code


//package com.java2s;

import android.graphics.Bitmap;

import android.webkit.WebView;

public class Main {
    public static Bitmap getBitmapForVisibleRegion(WebView webview) {
        Bitmap returnedBitmap = null;/*from   w w  w .jav  a 2s .c om*/
        webview.setDrawingCacheEnabled(true);
        returnedBitmap = Bitmap.createBitmap(webview.getDrawingCache());
        webview.setDrawingCacheEnabled(false);
        return returnedBitmap;
    }
}

Related Tutorials