List of usage examples for android.graphics Bitmap getByteCount
public final int getByteCount()
From source file:com.android.volley.plus.ImageCache.java
/** * Get the size in bytes of a bitmap.//from w ww. j a v a 2s.c o m * * @param bitmap * @return size in bytes */ // @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (OsVersionUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.shine.hotels.util.ImageCache.java
/** * Get the size in bytes of a bitmap./*from w w w . j av a 2 s . co m*/ * @param bitmap * @return size in bytes */ //@TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { //if (UIUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); //} // Pre HC-MR1 //return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.android.volley.cache.BitmapImageCache.java
/** * Get the size in bytes of a bitmap.// w ww .j a v a2 s . c o m */ @TargetApi(19) public static int getBitmapSize(Bitmap bitmap) { // 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.sqkj.engine.image.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// w ww . j ava 2s .c o m * @return size in bytes */ 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 (SdkUtils.hasKitKat()) { return bitmap.getAllocationByteCount(); } if (SdkUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.xiaodong.dream.catcher.demo.image.ImageCache.java
/** * Get the size in bytes of a bitmap./*from w w w. j a v a 2s.c o m*/ * @param bitmap * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (ImageUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.haipeng.libraryforandroid.cacheormemory.imageload.ImageCache.java
/** * Get the size in bytes of a bitmap.//from w w w . java 2 s. c om * @param bitmap * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (SDKVersionUtil.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.roach.framework.cache.ImageCache.java
/** * Get the size in bytes of a bitmap.//from www. jav a 2s .c om * @param bitmap * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (VersionUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.wowcow.chat10.imagecache.ImageCache.java
/** * Get the size in bytes of a bitmap./*from ww w . j a v a 2 s . co m*/ * * @param bitmap * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (VersionUtil.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.andreaszeiser.bob.ImageCache.java
/** * Get the size in bytes of a bitmap.// w w w .j a v a 2 s. com * * @param bitmap * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (UIUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.fivehundredpxdemo.android.storage.ImageCache.java
/** * Get the size in bytes of a bitmap./*from w w w. j av a2 s. c o m*/ * @param bitmap * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }