Hi, I want to get data in YCbCr_420_SP format from the Camera1_Preview event like this :
the line bmp.Initialize2(in)" line gives this error in the catch .
java.lang.RuntimeException: Error loading bitmap. Sub
I read this link about this problem,but with try and catch I can't make it work.
https://www.b4x.com/android/forum/t...late-the-camera-preview-frames.20073/#content.
There are negative and positive values in the stream array is this the problem.?
Can a Bitmap be filled with YCbCr format.? bmp.Initialize2(in)
B4X:
Sub Camera1_Preview (PreviewPic() As Byte)
If DateTime.Now > lastPreviewSaved + IntervalMs Then
Dim in As InputStream
Dim bmp As Bitmap
in.InitializeFromBytesArray(PreviewPic, 0, PreviewPic.Length)
Log("Length PrevPicArr=" & PreviewPic.length)
Log(PreviewPic(2000)) ' is there something in the array ?
Try
bmp.Initialize2(in)
ImageView1.Bitmap = bmp
Panel2.setbackgroundimage(bmp)
Catch
Log("catch " & LastException)
End Try
lastPreviewSaved =DateTime.Now
End If
End Sub
the line bmp.Initialize2(in)" line gives this error in the catch .
java.lang.RuntimeException: Error loading bitmap. Sub
I read this link about this problem,but with try and catch I can't make it work.
https://www.b4x.com/android/forum/t...late-the-camera-preview-frames.20073/#content.
There are negative and positive values in the stream array is this the problem.?
Can a Bitmap be filled with YCbCr format.? bmp.Initialize2(in)