WebView的截图有几种方式
(一)这种方式要求WebView必须设置setDrawingCacheEnabled(true)
/**
* 这种方法要求webview要设置setDrawingCacheEnabled(true);
* @return
*/
public Bitmap getWebViewFromCache(){
Bitmap drawingCacheBitmap = mWebView.getDrawingCache();
return drawingCacheBitmap;
}
(二)这种方式在安卓4.4已经废除,因为capturePicture方法废除了
public Bitmap getWebViewCapturePicture(){
Picture picture = mWebView.capturePicture();
Bitmap bitmap = Bitmap