Answers for "android frame to bitmap is null"

0

android frame to bitmap is null

ByteArrayOutputStream out = new ByteArrayOutputStream();
YuvImage yuvImage = new YuvImage(frame.getData(), ImageFormat.NV21, frame.getSize().getWidth(), frame.getSize().getHeight(), null);
yuvImage.compressToJpeg(new Rect(0, 0, frame.getSize().getWidth(), frame.getSize().getHeight()), 90, out);
byte[] imageBytes = out.toByteArray();
Bitmap image = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);
Posted by: Guest on January-25-2021

Code answers related to "android frame to bitmap is null"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language