Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.view.View; public class Main { public static Bitmap createPngScreenshot2(View view, int thumbnailWidth, int thumbnailHeight, int top) { if (view != null) { Bitmap mCapture; try { mCapture = Bitmap.createBitmap(thumbnailWidth, thumbnailHeight, Bitmap.Config.ARGB_8888); } catch (OutOfMemoryError e) { return null; } Canvas c = new Canvas(mCapture); c.drawColor(Color.BLACK); // final int left = view.getScrollX(); // final int top = view.getScrollY(); c.translate(0, -top); //c.scale(0.65f, 0.65f, left, top); try { // draw webview may nullpoint view.draw(c); } catch (Exception e) { } return mCapture; } return null; } }