String path = Environment.getExternalStorageDirectory()+"/yub/32.yuv" ; File file = new File(path); InputStream is = new FileInputStream(file); byte[] nv21Picture = getBytes(is); YuvImage image = new YuvImage(nv21Picture, ImageFormat.NV21, 360, 720, null); ByteArrayOutputStream os = new ByteArrayOutputStream(nv21Picture.length); image.compressToJpeg(new Rect(0, 0, 360, 720), 100, os); byte[] tmp = os.toByteArray(); Bitmap bitmap = BitmapFactory.decodeByteArray(tmp, 0,tmp.length);
nv21图片 转 bitmap
猜你喜欢
转载自blog.csdn.net/chailongger/article/details/80570351
今日推荐
周排行