Android examples for User Interface:View Bitmap
load Bitmap From View
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Canvas; import android.view.View; public class Main { public static Bitmap loadBitmapFromView(View v) { int w = v.getWidth(); // v.getLayoutParams().width int h = v.getHeight(); // v.getLayoutParams().height Bitmap b = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444); Canvas c = new Canvas(b); v.layout(0, 0, w, h);/*w ww.j a va2 s . co m*/ v.draw(c); return b; } }