Advertisement
myLoveOnlyForYou

Untitled

May 14th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.44 KB | None | 0 0
  1. val matrix = Matrix()
  2.  
  3.             matrix.postRotate(90F)
  4.  
  5.             val bitmapOrg = (mainImage.drawable as BitmapDrawable).bitmap
  6.             val scaledBitmap = Bitmap.createScaledBitmap(bitmapOrg, bitmapOrg.width, bitmapOrg.height, true)
  7.  
  8.             val rotatedBitmap =
  9.                 Bitmap.createBitmap(scaledBitmap, 0, 0, scaledBitmap.width, scaledBitmap.height, matrix, true)
  10.             mainImage.setImageBitmap(rotatedBitmap)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement