List of usage examples for android.graphics Bitmap getRowBytes
public final int getRowBytes()
From source file:com.egoists.coco_nut.android.cache.ImageCache.java
/** * Get the size in bytes of a bitmap.//from ww w. j av a 2 s. co m */ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1) public static int getBitmapSize(Bitmap bitmap) { if (EtcUtils.hasHoneycombMR1()) { return bitmap.getByteCount(); } // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.channelsoft.common.bitmapUtil.ImageCache.java
/** * Get the size in bytes of a bitmap.// w w w. ja v a2 s . c om * @param bitmap * @return size in bytes */ public static int getBitmapSize(Bitmap bitmap) { // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:gr.unfold.android.tsibato.images.ImageCache.java
@TargetApi(12) public static int getBitmapSize(BitmapDrawable value) { Bitmap bitmap = value.getBitmap(); if (Utils.hasHoneycombMR1()) { return bitmap.getByteCount(); }/*from w w w . j a va 2 s . co m*/ // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.sven.im.video.util.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)./* w w w . ja va 2s . c o m*/ * * @param value * @return size in bytes */ @TargetApi(19) 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.codingPower.framework.worker.ImageCache.java
/** * Get the size in bytes of a bitmap./*from w w w .jav a 2s .c om*/ * @param bitmap * @return size in bytes */ public static int getBitmapSize(Bitmap bitmap) { /*if (Utils.hasHoneycombMR1()) { return bitmap.getByteCount(); }*/ // Pre HC-MR1 return bitmap.getRowBytes() * bitmap.getHeight(); }
From source file:com.android.volley.plus.ImageCache.java
/** * Get the size in bytes of a bitmap.// 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.android.volley.cache.BitmapImageCache.java
/** * Get the size in bytes of a bitmap./*w w w .j a v a2 s. co 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.ruoogle.base.imgload.ImageCache.java
/** * Get the size in bytes of a bitmap.// w w w . j av a 2 s.com * @param bitmap * @return size in bytes */ @TargetApi(12) public static int getBitmapSize(Bitmap bitmap) { 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 w w. j a v a 2 s .com*/ * @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 a2 s. 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(); }