public staticDrawable layout2Drawable( int layouId ){ LayoutInflater inflator = getLayoutInflater(); View view = inflator.inflate(layouId, null); Bitmap bitmap = convertViewToBitmap(viewHelp); Drawable drawable = (Drawable)new BitmapDrawable(bitmap); return drawable; } public static Bitmap convertView2Bitmap(View view) { view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); view.layout(0, 0, width, view.getMeasuredHeight()); view.buildDrawingCache(); Bitmap bitmap = view.getDrawingCache(); return bitmap; }