-3

How can I make a screenshot from a textview background? in JPEG.

Hans Pour
  • 432
  • 6
  • 15

1 Answers1

0

You can ask the view to draw itself on a canvas. That's probably the simplest method.

Bitmap b = Bitmap.createBitmap(targetView.getWidth(),
                   targetView.getHeight(),
                   Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
targetView.draw(c);

See http://arpitonline.com/blog/2012/07/17/capturing-bitmaps-of-views-in-android/

matiash
  • 54,791
  • 16
  • 125
  • 154