iOS Question Rotate Image

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Guys

I am trying to achieve the exact same result in B4I for the code below

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

I would to be able to save the returned image.

Thank you
 
Top