static int getBitmapBytes(Bitmap bitmap) { int result; if(VERSION.SDK_INT >= 12) { result = bitmap.getByteCount(); } else { result = bitmap.getRowBytes() * bitmap.getHeight(); } if(result < 0) { throw new IllegalStateException("Negative size: " + bitmap); } else { return result; } }
获取bitmap字节数
最新推荐文章于 2024-10-14 16:36:25 发布