有一个简单的办法把来自摄像机的previewFrame字节数组成Android的图片? [英] Is there a simple way to turn the byte array from the camera's onPreviewFrame into a picture in android?

查看:409
本文介绍了有一个简单的办法把来自摄像机的previewFrame字节数组成Android的图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问,如果有一个简单的办法,因为有一个谷歌的问题,报告称,使用去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.

这篇关于有一个简单的办法把来自摄像机的previewFrame字节数组成Android的图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆