List of usage examples for android.graphics.drawable BitmapDrawable getBitmap
public final Bitmap getBitmap()
From source file:com.github.programmerr47.vkgroups.imageloading.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. Note that from Android 4.4 (KitKat) * onward this returns the allocated memory size of the bitmap which can be larger than the * actual bitmap data byte count (in the case it was re-used). * * @return size in bytes/*from ww w. j a va2 s . c o m*/ */ @TargetApi(VERSION_CODES.KITKAT) 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 (hasKitKat()) { return bitmap.getAllocationByteCount(); } return bitmap.getByteCount(); }
From source file:com.gokuai.yunkuandroidsdk.imageutils.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * * @param value// www .j ava 2 s. c o m * @return size in bytes */ @TargetApi(VERSION_CODES.KITKAT) 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(); }
From source file:com.inter.trade.imageframe.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * @param value//from w w w. j av a 2 s .c o m * @return size in bytes */ public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); // if (Utils.hasHoneycombMR1()) { // return bitmap.getByteCount(); // } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.tsu.common.image.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * @param value// www. ja v a2s. com * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (VersionUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.wetrain.client.customviews.imagecache.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * @param value//from w ww. j a va 2 s .c o m * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (Utills.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:us.happ.bitmap.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * @param value/*from ww w . j av a 2 s. c o m*/ * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (Happ.hasHoneycombMR1) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.afrozaar.jazzfestreporting.util.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * * @param value//from w w w .ja v a 2s . c o m * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (Utils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.androidsx.imagesearch.util.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * @param value/*from w w w . j a v a 2 s .c o m*/ * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (Platform.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.globant.mobile.handson.media.BitmapCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. * @param value//from ww w. ja v a 2 s.co m * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:org.iisgcp.waterwalk.utils.ImageCache.java
/** * Get the size in bytes of a bitmap in a BitmapDrawable. Note that from Android 4.4 (KitKat) * onward this returns the allocated memory size of the bitmap which can be larger than the * actual bitmap data byte count (in the case it was re-used). * * @param value//from w w w . j av a2s . c o m * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (Utils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }