Freigeben über


ImageDecoder.Crop Property

Definition

Return the cropping rectangle, if set. -or- Crop the output to subset of the (possibly) scaled image.

public Android.Graphics.Rect? Crop { [Android.Runtime.Register("getCrop", "()Landroid/graphics/Rect;", "", ApiSince=28)] get; [Android.Runtime.Register("setCrop", "(Landroid/graphics/Rect;)V", "", ApiSince=28)] set; }
[<get: Android.Runtime.Register("getCrop", "()Landroid/graphics/Rect;", "", ApiSince=28)>]
[<set: Android.Runtime.Register("setCrop", "(Landroid/graphics/Rect;)V", "", ApiSince=28)>]
member this.Crop : Android.Graphics.Rect with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Return the cropping rectangle, if set.

Java documentation for android.graphics.ImageDecoder.getCrop().

Property setter documentation:

Crop the output to subset of the (possibly) scaled image.

subset must be contained within the size set by #setTargetSize or the bounds of the image if setTargetSize was not called. Otherwise an IllegalStateException will be thrown by #decodeDrawable decodeDrawable/#decodeBitmap decodeBitmap.

NOT intended as a replacement for BitmapRegionDecoder#decodeRegion BitmapRegionDecoder.decodeRegion(). This supports all formats, but merely crops the output.

Like all setters on ImageDecoder, this must be called inside OnHeaderDecodedListener#onHeaderDecoded onHeaderDecoded.

Java documentation for android.graphics.ImageDecoder.setCrop(android.graphics.Rect).

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.

Applies to