Is there a simple way to turn the byte array from the camera's onPreviewFrame into a picture in android?

后端 未结 2 1307
孤独总比滥情好
孤独总比滥情好 2021-01-12 14:45

I ask if there is a simple way because there is a google issue report saying that using decodeByteArray isn\'t possible. But that report originated in 2008 and I was hoping

2条回答
  •  一个人的身影
    2021-01-12 15:31

    The easiest way is to create a BufferedImage the following way:

    Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0. data.length);
    

    data is the byte array.

提交回复
热议问题