Sdílet prostřednictvím


BitmapFactory.Options.InTargetDensity Property

Definition

The pixel density of the destination this bitmap will be drawn to.

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

Property Value

Attributes

Remarks

The pixel density of the destination this bitmap will be drawn to. This is used in conjunction with #inDensity and #inScaled to determine if and how to scale the bitmap before returning it.

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 the Resources object's DisplayMetrics. The other functions will leave it as-is and no scaling for density will be performed.

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

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