Android Guides | Samples

Android.Graphics.Drawables.ShapeDrawable.SetColorFilter Method

Specify an optional color filter for the drawable.

Syntax

[Android.Runtime.Register("setColorFilter", "(Landroid/graphics/ColorFilter;)V", "GetSetColorFilter_Landroid_graphics_ColorFilter_Handler")]
public override Void SetColorFilter (ColorFilter cf)

Parameters

cf
the color filter to apply, or null to remove the existing color filter

Remarks

Specify an optional color filter for the drawable.

If a Drawable has a ColorFilter, each output pixel of the Drawable's drawing contents will be modified by the color filter before it is blended onto the render target of a Canvas.

Pass null to remove any existing color filter.

Note: Setting a non-null color filter disables Drawable.SetTintList(ColorStateList).

[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