Q:

Save a collection of stacked android views as image?

I have 1 imageview and 3 textViews stacked on top of the imageView. It's like a business card, where the image is the background of the business card, and the textViews are 3 lines of text with different formatting (which the user can customize).
I want to save the final output of the customization (i.e. the imageview and 3 textViews on top of it) as a single image so that it can be printed/shared via facebook.
is there any way to convert the whole collection to a image?, or can a screenshot be taken of the specific rectangular area? any information would be much helpful, thanks.

A:

As you can get the bitmap in the following way, in the next step you can use the bitmap as you wish.
Bitmap bitmap;

View v1 = ContainerLayout.getRootView();

v1.setDrawingCacheEnabled(true);

bitmap = Bitmap.createBitmap(v1.getDrawingCache());

v1.setDrawingCacheEnabled(false);

