Share via


BitmapFactory.Options.InSampleSize Property

Definition

If set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory.

[Android.Runtime.Register("inSampleSize")]
public int InSampleSize { get; set; }
[<Android.Runtime.Register("inSampleSize")>]
member this.InSampleSize : int with get, set

Property Value

Attributes

Remarks

If set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory. The sample size is the number of pixels in either dimension that correspond to a single pixel in the decoded bitmap. For example, inSampleSize == 4 returns an image that is 1/4 the width/height of the original, and 1/16 the number of pixels. Any value <= 1 is treated the same as 1. Note: the decoder uses a final value based on powers of 2, any other value will be rounded down to the nearest power of 2.

Java documentation for android.graphics.BitmapFactory.Options.inSampleSize.

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