ImageDecoder.MutableRequired Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Return whether the decoded Bitmap
will be mutable. -or- Specify whether the Bitmap
should be mutable.
public bool MutableRequired { [Android.Runtime.Register("isMutableRequired", "()Z", "", ApiSince=28)] get; [Android.Runtime.Register("setMutableRequired", "(Z)V", "", ApiSince=28)] set; }
[<get: Android.Runtime.Register("isMutableRequired", "()Z", "", ApiSince=28)>]
[<set: Android.Runtime.Register("setMutableRequired", "(Z)V", "", ApiSince=28)>]
member this.MutableRequired : bool with get, set
Property Value
- Attributes
Remarks
Property getter documentation:
Return whether the decoded Bitmap
will be mutable.
Java documentation for android.graphics.ImageDecoder.isMutableRequired()
.
Property setter documentation:
Specify whether the Bitmap
should be mutable.
By default, a Bitmap
created by #decodeBitmap decodeBitmap
will be immutable i.e. Bitmap#isMutable() Bitmap.isMutable()
returns false
. This can be changed with setMutableRequired(true)
.
Mutable Bitmaps are incompatible with #ALLOCATOR_HARDWARE
, because Bitmap.Config#HARDWARE
Bitmaps cannot be mutable. Attempting to combine them will throw an java.lang.IllegalStateException
.
Mutable Bitmaps are also incompatible with #decodeDrawable decodeDrawable
, which would require retrieving the Bitmap from the returned Drawable in order to modify. Attempting to decode a mutable Drawable
will throw an java.lang.IllegalStateException
.
Like all setters on ImageDecoder, this must be called inside OnHeaderDecodedListener#onHeaderDecoded onHeaderDecoded
.
Java documentation for android.graphics.ImageDecoder.setMutableRequired(boolean)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.