Stay organized with collections
Save and categorize content based on your preferences.
BitmapParams
class BitmapParams
Summary
Public constructors |
Create a default BitmapParams object.
|
Public methods |
Bitmap.Config |
Get the actual bitmap config used to decode the bitmap after the decoding.
|
Bitmap.Config |
Retrieve the preferred bitmap config in the params.
|
Unit |
Set the preferred bitmap config for the decoder to decode into.
|
Public constructors
BitmapParams
BitmapParams()
Create a default BitmapParams object. By default, it uses Bitmap.Config.ARGB_8888
as the preferred bitmap config.
Public methods
getActualConfig
fun getActualConfig(): Bitmap.Config
Get the actual bitmap config used to decode the bitmap after the decoding.
Return |
Bitmap.Config |
the actual bitmap config used. This value cannot be null . |
getPreferredConfig
fun getPreferredConfig(): Bitmap.Config
Retrieve the preferred bitmap config in the params.
Return |
Bitmap.Config |
the preferred bitmap config. This value cannot be null . |
setPreferredConfig
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
config by default. After decode, the actual config used can be retrieved by getActualConfig()
.
Parameters |
config |
Bitmap.Config: the preferred bitmap config to use. This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaMetadataRetriever.BitmapParams\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBitmapParams\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaMetadataRetriever.BitmapParams \"View this page in Java\") \n\n```\nclass BitmapParams\n```\n\n|---|--------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaMetadataRetriever.BitmapParams](#) |\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------|---|\n| [BitmapParams](#BitmapParams())`()` Create a default BitmapParams object. |\n\n| Public methods ||\n|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Bitmap.Config](../graphics/Bitmap.Config.html#) | [getActualConfig](#getActualConfig())`()` Get the actual bitmap config used to decode the bitmap after the decoding. |\n| [Bitmap.Config](../graphics/Bitmap.Config.html#) | [getPreferredConfig](#getPreferredConfig())`()` Retrieve the preferred bitmap config in the params. |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setPreferredConfig](#setPreferredConfig(android.graphics.Bitmap.Config))`(`config:` `[Bitmap.Config](../graphics/Bitmap.Config.html#)`)` Set the preferred bitmap config for the decoder to decode into. |\n\nPublic constructors\n-------------------\n\n### BitmapParams\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBitmapParams()\n```\n\nCreate a default BitmapParams object. By default, it uses [Bitmap.Config.ARGB_8888](../graphics/Bitmap.Config.html#) as the preferred bitmap config.\n\nPublic methods\n--------------\n\n### getActualConfig\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getActualConfig(): Bitmap.Config\n```\n\nGet the actual bitmap config used to decode the bitmap after the decoding.\n\n| Return ||\n|--------------------------------------------------|-------------------------------------------------------------|\n| [Bitmap.Config](../graphics/Bitmap.Config.html#) | the actual bitmap config used. This value cannot be `null`. |\n\n### getPreferredConfig\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getPreferredConfig(): Bitmap.Config\n```\n\nRetrieve the preferred bitmap config in the params.\n\n| Return ||\n|--------------------------------------------------|-----------------------------------------------------------|\n| [Bitmap.Config](../graphics/Bitmap.Config.html#) | the preferred bitmap config. This value cannot be `null`. |\n\n### setPreferredConfig\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setPreferredConfig(config: Bitmap.Config): Unit\n```\n\nSet 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](../graphics/Bitmap.Config.html#) config by default. After decode, the actual config used can be retrieved by [getActualConfig()](#getActualConfig()).\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------------|\n| `config` | [Bitmap.Config](../graphics/Bitmap.Config.html#): the preferred bitmap config to use. This value cannot be `null`. |"]]