Android Guides | Samples

Android.Graphics.Drawables.NinePatchDrawable Class

A resizeable bitmap, with stretchable areas that you define.

See Also: NinePatchDrawable

Syntax

[Android.Runtime.Register("android/graphics/drawable/NinePatchDrawable", DoNotGenerateAcw=true)]
public class NinePatchDrawable : Drawable

Remarks

A resizeable bitmap, with stretchable areas that you define. This type of image is defined in a .png file with a special format.

Developer Guides

For more information about how to use a NinePatchDrawable, read the Canvas and Drawables developer guide. For information about creating a NinePatch image file using the draw9patch tool, see the Draw 9-patch tool guide.

[Android Documentation]

Requirements

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

The members of Android.Graphics.Drawables.NinePatchDrawable are listed below.

See Also: Drawable

Public Constructors

Create drawable from existing nine-patch, not dealing with density.
Create drawable from existing nine-patch, setting initial target density based on the display metrics of the resources.
Create drawable from raw nine-patch data, not dealing with density.
Create drawable from raw nine-patch data, setting initial target density based on the display metrics of the resources.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
override
OpacityInt32. Returns a PixelFormat value of OPAQUE or TRANSLUCENT.
[read-only]
PaintPaint.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

override
Draw(Canvas)
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
override
SetAlpha(Int32)
Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque.
override
SetColorFilter(ColorFilter)
Specify an optional color filter for the drawable.
SetTargetDensity(Canvas)
Set the density scale at which this drawable will be rendered.
SetTargetDensity(DisplayMetrics)
Set the density scale at which this drawable will be rendered.
SetTargetDensity(Int32)
Set the density at which this drawable will be rendered.