Created
August 15, 2022 10:00
-
-
Save Maxim-Kolmogorov/971d1c291ec45b1fbe07ee04a359526d to your computer and use it in GitHub Desktop.
Android rotate photo 90f.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val mPicture = Camera.PictureCallback { data, _ -> | |
val myBitmap: Bitmap = BitmapFactory.decodeByteArray(data, 0, data.size) | |
// Rotate image | |
val matrix = Matrix() | |
matrix.postRotate(90f) | |
val rotatedBitmap = Bitmap.createBitmap(myBitmap, 0, 0, myBitmap.width, myBitmap.height, matrix, true) | |
// Ready, but before please init var viewPhoto: ImageView | |
// viewPhoto.setImageBitmap(rotatedBitmap) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment