Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
ImageDecoder.OnHeaderDecodedListener
android.graphics.ImageDecoder.OnHeaderDecodedListener
|
Interface for changing the default settings of a decode.
Supply an instance to
decodeDrawable
or decodeBitmap
,
which will call onHeaderDecoded
(in the same thread) once the size is known. The implementation of
onHeaderDecoded
can then
change the decode settings as desired.
Summary
Public methods
onHeaderDecoded
public abstract void onHeaderDecoded (ImageDecoder decoder,
ImageDecoder.ImageInfo info,
ImageDecoder.Source source)
Called by ImageDecoder
when the header has been decoded and
the image size is known.
Parameters |
decoder |
ImageDecoder : the object performing the decode, for changing
its default settings.
This value cannot be null . |
info |
ImageDecoder.ImageInfo : information about the encoded image.
This value cannot be null . |
source |
ImageDecoder.Source : object that created decoder .
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,["# ImageDecoder.OnHeaderDecodedListener\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nImageDecoder.OnHeaderDecodedListener\n====================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/graphics/ImageDecoder.OnHeaderDecodedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nImageDecoder.OnHeaderDecodedListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------|\n| android.graphics.ImageDecoder.OnHeaderDecodedListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for changing the default settings of a decode.\n\nSupply an instance to\n[decodeDrawable](/reference/android/graphics/ImageDecoder#decodeDrawable(android.graphics.ImageDecoder.Source,%20android.graphics.ImageDecoder.OnHeaderDecodedListener))\nor [decodeBitmap](/reference/android/graphics/ImageDecoder#decodeBitmap(android.graphics.ImageDecoder.Source,%20android.graphics.ImageDecoder.OnHeaderDecodedListener)),\nwhich will call [onHeaderDecoded](/reference/android/graphics/ImageDecoder.OnHeaderDecodedListener#onHeaderDecoded(android.graphics.ImageDecoder,%20android.graphics.ImageDecoder.ImageInfo,%20android.graphics.ImageDecoder.Source))\n(in the same thread) once the size is known. The implementation of\n[onHeaderDecoded](/reference/android/graphics/ImageDecoder.OnHeaderDecodedListener#onHeaderDecoded(android.graphics.ImageDecoder,%20android.graphics.ImageDecoder.ImageInfo,%20android.graphics.ImageDecoder.Source)) can then\nchange the decode settings as desired.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onHeaderDecoded](/reference/android/graphics/ImageDecoder.OnHeaderDecodedListener#onHeaderDecoded(android.graphics.ImageDecoder,%20android.graphics.ImageDecoder.ImageInfo,%20android.graphics.ImageDecoder.Source))`(`[ImageDecoder](/reference/android/graphics/ImageDecoder)` decoder, `[ImageDecoder.ImageInfo](/reference/android/graphics/ImageDecoder.ImageInfo)` info, `[ImageDecoder.Source](/reference/android/graphics/ImageDecoder.Source)` source) ` Called by [ImageDecoder](/reference/android/graphics/ImageDecoder) when the header has been decoded and the image size is known. |\n\nPublic methods\n--------------\n\n### onHeaderDecoded\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onHeaderDecoded (ImageDecoder decoder, \n ImageDecoder.ImageInfo info, \n ImageDecoder.Source source)\n```\n\nCalled by [ImageDecoder](/reference/android/graphics/ImageDecoder) when the header has been decoded and\nthe image size is known.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|--------------------------------------------------------------------------------------------------------------------------|\n| `decoder` | `ImageDecoder`: the object performing the decode, for changing its default settings. This value cannot be `null`. \u003cbr /\u003e |\n| `info` | `ImageDecoder.ImageInfo`: information about the encoded image. This value cannot be `null`. \u003cbr /\u003e |\n| `source` | `ImageDecoder.Source`: object that created `decoder`. This value cannot be `null`. \u003cbr /\u003e |"]]