- create an empty bitmap
- create a new Canvas object and pass this bitmap to it
- call view.draw(Canvas) passing it the canvas object you just created. Refer Documentation of method for details.
- Use Bitmap.compress() to write the contents of the bitmap to an OutputStream, file maybe.
Pseudo code:
Bitmap bitmap = Bitmap.createBitmap( view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);