在我的应用程序中有一个 WebView 小部件,它会打开一个大页面。
如何在 WebView 中捕获页面的可见部分? capturePicture()
不适合它...
最佳答案
public static Bitmap getBitmapForVisibleRegion(WebView webview) {
Bitmap returnedBitmap = null;
webview.setDrawingCacheEnabled(true);
returnBitmap = Bitmap.createBitmap(webview.getDrawingCache());
webview.setDrawingCacheEnabled(false);
return returnedBitmap;
}
关于android - WebView中页面可见部分的截图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13565608/