1

I rotate a view by an angle. I want to get bitmap from this view. I am getting bitmap by calling getdrawingcache(), but not getting rotating view by an angle. It is giving a view without rotating.

TheSoal
  • 11
  • 2
  • I am using following code: private void captureUsingDrawingCache(){ targetView.buildDrawingCache(); Bitmap b1 = targetView.getDrawingCache(); Bitmap b = b1.copy(Bitmap.Config.ARGB_8888, false); BitmapDrawable d = new BitmapDrawable(b); canvasView.setImageDrawable(d); targetView.destroyDrawingCache(); } – TheSoal Nov 05 '15 at 14:21
  • 1
    Do not add code in comment. Instead edit the question with this code. – Henry Nov 05 '15 at 14:23
  • check out my answer here: http://stackoverflow.com/questions/37254577/how-can-i-take-screenshot-of-rotated-textview-with-emoji/43116641#43116641 – Wops Mar 30 '17 at 11:32

1 Answers1

0

For rotation view use this:

view.setRotation(45);

But your API must be higher than 11

walkmn
  • 2,322
  • 22
  • 29