有一个简单的办法把来自摄像机的previewFrame字节数组成Android的图片?字节、有一个、摄像机、办法

2023-09-06 10:00:17 作者:亡鱼深海

我问,如果有一个简单的办法,因为有一个谷歌的问题,报告称,使用去codeByteArray是不可能的。但是,该报告起源于2008年,我希望有一个解决方案,不贴在那里。关于这一问题的报告中列出的方法是去$ C C自己的格式$,但我preFER来没有把在和减缓计划。任何帮助都将是AP preciated。

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 there was a solution not posted on there. The method listed on the issue report was to decode the format yourself, but I'd prefer to not have to put that in and slow down the program. Any help at all would be appreciated.

推荐答案

最简单的方法是创建一个BufferedImage以下方式:

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

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

数据的字节数组。

data is the byte array.

 
精彩推荐
图片推荐