# MediaMetadataRetriever.BitmapParams

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# BitmapParams

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/MediaMetadataRetriever.BitmapParams "View this page in Java")  

```
class BitmapParams
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                         ||
| ↳ | [android.media.MediaMetadataRetriever.BitmapParams](https://developer.android.com/reference/kotlin/android/media/MediaMetadataRetriever.BitmapParams#) |

## Summary

|                                                                             Public constructors                                                                              ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [BitmapParams](https://developer.android.com/reference/kotlin/android/media/MediaMetadataRetriever.BitmapParams#BitmapParams())`()` Create a default BitmapParams object. |

|                                                                                                                                                                                                                           Public methods                                                                                                                                                                                                                            ||
|------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap.Config](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#) | [getActualConfig](https://developer.android.com/reference/kotlin/android/media/MediaMetadataRetriever.BitmapParams#getActualConfig())`()` Get the actual bitmap config used to decode the bitmap after the decoding.                                                                                                                                          |
| [Bitmap.Config](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#) | [getPreferredConfig](https://developer.android.com/reference/kotlin/android/media/MediaMetadataRetriever.BitmapParams#getPreferredConfig())`()` Retrieve the preferred bitmap config in the params.                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                         | [setPreferredConfig](https://developer.android.com/reference/kotlin/android/media/MediaMetadataRetriever.BitmapParams#setPreferredConfig(android.graphics.Bitmap.Config))`(`config:` `[Bitmap.Config](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#)`)` Set the preferred bitmap config for the decoder to decode into. |

## Public constructors

### BitmapParams

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
BitmapParams()
```

Create a default BitmapParams object. By default, it uses[Bitmap.Config.ARGB_8888](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#)as the preferred bitmap config.

## Public methods

### getActualConfig

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getActualConfig(): Bitmap.Config
```

Get the actual bitmap config used to decode the bitmap after the decoding.

|                                                                              Return                                                                              ||
|------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| [Bitmap.Config](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#) | the actual bitmap config used. This value cannot be`null`. |

### getPreferredConfig

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getPreferredConfig(): Bitmap.Config
```

Retrieve the preferred bitmap config in the params.

|                                                                             Return                                                                             ||
|------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [Bitmap.Config](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#) | the preferred bitmap config. This value cannot be`null`. |

### setPreferredConfig

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setPreferredConfig(config: Bitmap.Config): Unit
```

Set the preferred bitmap config for the decoder to decode into. If not set, or the request cannot be met, the decoder will output in[Bitmap.Config.ARGB_8888](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#)config by default. After decode, the actual config used can be retrieved by[getActualConfig()](https://developer.android.com/reference/kotlin/android/media/MediaMetadataRetriever.BitmapParams#getActualConfig()).

|                                                                                   Parameters                                                                                   ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `config` | [Bitmap.Config](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.Config.html#):the preferred bitmap config to use. This value cannot be`null`. |