Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Canvas; import android.view.View; public class Main { /** * Draws view to a bitmap image. */ public static Bitmap drawToBitmap(final View viewToDraw) { final Bitmap bitmap = Bitmap.createBitmap(viewToDraw.getWidth(), viewToDraw.getHeight(), Bitmap.Config.ARGB_8888); final Canvas canvas = new Canvas(bitmap); viewToDraw.draw(canvas); return bitmap; } }