Android Guides | Samples

Android.Graphics.Drawables.ColorDrawable Class

A specialized Drawable that fills the Canvas with a specified color.

See Also: ColorDrawable

Syntax

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

Remarks

A specialized Drawable that fills the Canvas with a specified color. Note that a ColorDrawable ignores the ColorFilter.

It can be defined in an XML file with the <color> element.

[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.ColorDrawable are listed below.

See Also: Drawable

Public Constructors

Creates a new black ColorDrawable.
Creates a new ColorDrawable with the specified color.

Protected Constructors

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

Public Properties

override
AlphaInt32. Returns the alpha value of this drawable's color.
ColorColor. Gets the drawable's color value.
[read-only]
override
OpacityInt32. Return the opacity/transparency of this Drawable.

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)
Sets the color's alpha value.
override
SetColorFilter(ColorFilter)
Sets the color filter applied to this color.