react-native-view-shot icon indicating copy to clipboard operation
react-native-view-shot copied to clipboard

同时多张截图,第二张图片的大小复用了第一次图片的大小

Open goldrod opened this issue 3 years ago • 1 comments

goldrod avatar Mar 11 '21 02:03 goldrod

@NonNull private static Bitmap getBitmapForScreenshot(final int width, final int height) { synchronized (guardBitmaps) { for (final Bitmap bmp : weakBitmaps) { if (bmp.getWidth() * bmp.getHeight() <= width * height) { weakBitmaps.remove(bmp); bmp.eraseColor(Color.TRANSPARENT); return bmp; } } }

    return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
}

这个方法,导致后面的图片宽高 复用了前面的

触发条件: 1.同时多张截图 2.宽高 ,后面的图片大于前面图片

goldrod avatar Mar 11 '21 02:03 goldrod