Compartilhar via


BitmapFactory.Options.InDensity Property

Definition

The pixel density to use for the bitmap.

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

Property Value

Attributes

Remarks

The pixel density to use for the bitmap. This will always result in the returned bitmap having a density set for it (see Bitmap#setDensity(int) Bitmap.setDensity(int)). In addition, if #inScaled is set (which it is by default} and this density does not match #inTargetDensity, then the bitmap will be scaled to the target density before being returned.

If this is 0, BitmapFactory#decodeResource(Resources, int), BitmapFactory#decodeResource(Resources, int, android.graphics.BitmapFactory.Options), and BitmapFactory#decodeResourceStream will fill in the density associated with the resource. The other functions will leave it as-is and no density will be applied.

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

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

See also