普通的webview:
public static Bitmap shotWebView( WebView webView, ImageView imageView) { try { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // Android5.0以上 float scale = webView.getScale(); int width = webView.getWidth(); int height = (int) (webView.getContentHeight() * scale + 0.5); final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); webView.draw(canvas); // 保存图片 Log.d("bitmap888--","45"+bitmap.getByteCount()); savePicture(webView.getContext(), bitmap); return bitmap; } else { // Android5.0以下 Picture picture = webView.capturePicture(); int width = picture.getWidth(); int height = picture.getHeight(); if (width >