Hi.
Excuse me for duplicate post.
But i cannot rotate bitmap with all of rotate code in forum.
I take picture from camera but when save it,picture is rotated.
I try to rotate picture with below code but it get error
Is there any way to adjust camera orienation or rotate bitmap?
Excuse me for duplicate post.
But i cannot rotate bitmap with all of rotate code in forum.
I take picture from camera but when save it,picture is rotated.
I try to rotate picture with below code but it get error
Is there any way to adjust camera orienation or rotate bitmap?
B4X:
Sub RotateImage(original As Bitmap, degree As Float) As Bitmap
Dim matrix As JavaObject
matrix.InitializeNewInstance("android.graphics.Matrix", Null)
matrix.RunMethod("postRotate", Array(degree))
Dim bmp As JavaObject
bmp.InitializeStatic("android.graphics.Bitmap")
Dim NewImage As Bitmap = bmp.RunMethod("createBitmap", Array(original, 0, 0, original.Width, original.Height, _
matrix, True))
Return NewImage
End Sub
Sub camera_PictureTaken (Data() As Byte)
exCam.SavePictureToFile(Data,File.DirInternalCache,"temp.png")
pnlcamera.Bitmap = RotateImage(LoadBitmap(File.DirInternalCache,"temp.png"),90)
End Sub