0
我試圖採取的Android的WebView的全貌,但只有設備的可視區域捕捉等領域得到變灰out.Here是代碼:無法捕捉到的WebView的全快照的Android
public Bitmap getWebViewFullImage(final WebView webView) {
try {
Picture picture = webView.capturePicture();
int width=picture.getWidth();
int height=picture.getHeight();
Bitmap bm = Bitmap.createBitmap(width, height
, Bitmap.Config.ARGB_8888);
Canvas bigcanvas = new Canvas(bm);
picture.draw(bigcanvas);
return bm;
}
catch (Exception e) {
return null;
}
}
我在onPageFinished中調用了getWebViewFullImage函數。 –