0
如何获取网页截图的截图,如果它太长,并将其存储在内部存储。因此,例如,如果我的webview显示“google.com”,并且我尝试下面的代码,它会截取屏幕截图并将其存储为.jpg。但如果我的webview显示“stackoverflow.com”,由于这个网页太长,应用程序崩溃。一些帮助将不胜感激。长网页的Android截图
Picture picture=this.getCurrentWebView().capturePicture();
Bitmap b = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
picture.draw(c);
FileOutputStream fos = null;
try {
fos = new FileOutputStream("mnt/sdcard/myjpg.jpg");
if (fos != null){
b.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.close();
}
}
catch(Exception e)
{
}
我希望从一个长的WebView创建多个图像,并将其存储在一个文件夹或文件。 – user1932345