Android Guides | Samples

Android.Graphics.Bitmap.Density Property


[get: Android.Runtime.Register("getDensity", "()I", "GetGetDensityHandler")]
[set: Android.Runtime.Register("setDensity", "(I)V", "GetSetDensity_IHandler")]
public Int32 Density { get; set; }

See Also


Get method documentation[Android Documentation]

Returns the density for this bitmap.

The default density is the same density as the current display, unless the current application does not support different screen densities in which case it is DisplayMetrics.DensityDefault. Note that compatibility mode is determined by the application that was initially loaded into a process -- applications that share the same process should all have the same compatibility, or ensure they explicitly set the density of their bitmaps appropriately.

Set method documentation[Android Documentation]

Specifies the density for this bitmap. When the bitmap is drawn to a Canvas that also has a density, it will be scaled appropriately.


Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions:
Since: Added in API level 4