修改获取屏尺寸为真实尺寸,优化截图尺寸和屏幕尺寸不一致问题

This commit is contained in:
lulee007
2018-01-03 14:01:50 +08:00
parent 9770588e67
commit 463f87860c
2 changed files with 10 additions and 2 deletions

View File

@@ -75,6 +75,7 @@ public class ImageWrapper {
int rowPadding = plane.getRowStride() - pixelStride * image.getWidth();
Bitmap bitmap = Bitmap.createBitmap(image.getWidth() + rowPadding / pixelStride, image.getHeight(), Bitmap.Config.ARGB_8888);
bitmap.copyPixelsFromBuffer(buffer);
bitmap = Bitmap.createBitmap(bitmap, 0, 0, image.getWidth(), image.getHeight());
return bitmap;
}