/** * Get the size in bytes of a bitmap. * * @param bitmap The bitmap to calculate the size of. * @return size of bitmap in bytes. */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (Utils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }