# BitmapCompat

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Methods](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat#)  

# BitmapCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
BitmapCompat
`  
`

extends Object


``


`

|---|------------------------------------------|
| java.lang.Object                            ||
| ↳ | android.support.v4.graphics.BitmapCompat |

<br />

*** ** * ** ***

Helper for accessing features in[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html).

## Summary

|                                                                                                                                                                                   ### Public methods                                                                                                                                                                                    ||
|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static int`     | ` `[getAllocationByteCount](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat#getAllocationByteCount(android.graphics.Bitmap))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap) ` Returns the size of the allocated memory used to store this bitmap's pixels in a backwards compatible way. |
| ` static boolean` | ` `[hasMipMap](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat#hasMipMap(android.graphics.Bitmap))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap) `                                                                                                                                      |
| ` static void`    | ` `[setHasMipMap](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat#setHasMipMap(android.graphics.Bitmap, boolean))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap, boolean hasMipMap) `                                                                                                    |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public methods

### getAllocationByteCount

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getAllocationByteCount (Bitmap bitmap)
```

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

<br />

|                                  Parameters                                  ||
|----------|--------------------------------------------------------------------|
| `bitmap` | `Bitmap`: the bitmap in which to return its allocation size <br /> |

|                  Returns                   ||
|-------|-------------------------------------|
| `int` | the allocation size in bytes <br /> |

### hasMipMap

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean hasMipMap (Bitmap bitmap)
```

<br />

<br />

|        Parameters         ||
|----------|-----------------|
| `bitmap` | `Bitmap` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### setHasMipMap

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setHasMipMap (Bitmap bitmap, 
                boolean hasMipMap)
```

<br />

<br />

|          Parameters           ||
|-------------|------------------|
| `bitmap`    | `Bitmap` <br />  |
| `hasMipMap` | `boolean` <br /> |

-

  ## Classes

  - [BitmapCompat](https://developer.android.com/reference/android/support/v4/graphics/BitmapCompat)
  - [ColorUtils](https://developer.android.com/reference/android/support/v4/graphics/ColorUtils)
  - [PaintCompat](https://developer.android.com/reference/android/support/v4/graphics/PaintCompat)