ниже моего кода:
Код: Выделить всё
Image.Plane[] planes = image.getPlanes();
ByteBuffer buffer = planes[0].getBuffer();
int pixelStride = planes[0].getPixelStride();
int rowStride = planes[0].getRowStride();
int rowPadding = rowStride - pixelStride * mWidth;
// create bitmap
//mWidth and mHeight is device's size
bitmap = Bitmap.createBitmap(mWidth + rowPadding / pixelStride, mHeight - getStatusBarHeight() - getNavigationBarHeight(CaptureService.this), Bitmap.Config.ARGB_8888);
int bytesPerPixel = ImageFormat.getBitsPerPixel(ImageFormat.YUV_420_888) / 8;
buffer.position((getStatusBarHeight() * rowStride) / bytesPerPixel);
bitmap.copyPixelsFromBuffer(buffer);
// write bitmap to a file
fos = new FileOutputStream(mStoreDir + "screen.jpg");
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);

< /p>

Подробнее здесь: https://stackoverflow.com/questions/785 ... the-screen