获取bitmap的大小
作者:
linheimx | 来源:发表于
2016-10-04 08:57 被阅读840次
有多少字节?
public static int getBitmapSize(BitmapDrawable value) {
Bitmap bitmap = value.getBitmap();
// From KitKat onward use getAllocationByteCount() as allocated bytes can potentially be
// larger than bitmap byte count.
if (Utils.hasKitKat()) {
return bitmap.getAllocationByteCount();
}
if (Utils.hasHoneycombMR1()) {
return bitmap.getByteCount();
}
// Pre HC-MR1
return bitmap.getRowBytes() * bitmap.getHeight();
}
本文标题:获取bitmap的大小
本文链接:https://www.haomeiwen.com/subject/hbijyttx.html
网友评论