Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

BitmapCompat

class BitmapCompat
kotlin.Any
   ↳ androidx.core.graphics.BitmapCompat

Helper for accessing features in android.graphics.Bitmap.

Summary

Public methods

static Int
getAllocationByteCount(@NonNull bitmap: Bitmap)

Returns the size of the allocated memory used to store this bitmap's pixels in a backwards compatible way.

static Boolean
hasMipMap(@NonNull bitmap: Bitmap)

static Unit
setHasMipMap(@NonNull bitmap: Bitmap, hasMipMap: Boolean)

Public methods

getAllocationByteCount

static fun getAllocationByteCount(@NonNull bitmap: Bitmap): Int

Returns the size of the allocated memory used to store this bitmap's pixels in a backwards compatible way.

Parameters
bitmap Bitmap: the bitmap in which to return its allocation size
Return
Int: the allocation size in bytes

hasMipMap

static fun hasMipMap(@NonNull bitmap: Bitmap): Boolean

setHasMipMap

static fun setHasMipMap(@NonNull bitmap: Bitmap, hasMipMap: Boolean): Unit