FileDocCategorySizeDatePackage
BitmapCompat.javaAPI DocAndroid 5.1 API3518Thu Mar 12 22:22:56 GMT 2015android.support.v4.graphics

BitmapCompat

public class BitmapCompat extends Object
Helper for accessing features in {@link android.graphics.Bitmap} introduced after API level 4 in a backwards compatible fashion.

Fields Summary
static final BitmapImpl
IMPL
Select the correct implementation to use for the current platform.
Constructors Summary
Methods Summary
public static intgetAllocationByteCount(android.graphics.Bitmap bitmap)
Returns the size of the allocated memory used to store this bitmap's pixels in a backwards compatible way.

param
bitmap the bitmap in which to return it's allocation size
return
the allocation size in bytes

        return IMPL.getAllocationByteCount(bitmap);
    
public static booleanhasMipMap(android.graphics.Bitmap bitmap)

        final int version = android.os.Build.VERSION.SDK_INT;
        if (version >= 19) {
            IMPL = new KitKatBitmapCompatImpl();
        } else if (version >= 18) {
            IMPL = new JbMr2BitmapCompatImpl();
        } else if (version >= 12) {
            IMPL = new HcMr1BitmapCompatImpl();
        } else {
            IMPL = new BaseBitmapImpl();
        }
    
        return IMPL.hasMipMap(bitmap);
    
public static voidsetHasMipMap(android.graphics.Bitmap bitmap, boolean hasMipMap)

        IMPL.setHasMipMap(bitmap, hasMipMap);