public static Bitmap decodeToBitMap(byte[] data, Camera _camera) {
Camera.Size size = _camera.getParameters().getPreviewSize();
try {
YuvImage image = new YuvImage(data, ImageFormat.NV21, size.width, size.height, null);
if (image != null) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compressToJpeg(new Rect(0, 0, size.width, size.height), 80, stream);
Bitmap bmp = BitmapFactory.decodeByteArray(stream.toByteArray(), 0, stream.size());
stream.close();
return bmp;
}
} catch (Exception ex) {
}
return null;
}
ConUtil.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:MegviiFacepp-Android-SDK
作者:
评论列表
文章目录