Public Sub PreviewImageToYUB(data() As Byte) As bitmap
Dim size, previewFormat As Object, BMP as bitmap
r.target = parameters
size = r.RunMethod("getPreviewSize")
previewFormat = r.RunMethod("getPreviewFormat")
Log("previewFormat: " & previewFormat)
r.target = size
Dim width = r.GetField("width"), height = r.GetField("height") As Int
Dim yuvImage As Object = r.CreateObject2("android.graphics.YuvImage", Array As Object(data, previewFormat, width, height, Null), Array As String("[B", "java.lang.int", "java.lang.int", "java.lang.int", "[I"))
'How do I go from a yuvImage to a Bitmap?
Return BMP
End Sub