Drawable.SetColorFilter Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SetColorFilter(ColorFilter) |
Specify an optional color filter for the drawable. |
SetColorFilter(Color, PorterDuff+Mode) |
Specify a color and Porter-Duff mode to be the color filter for this drawable. |
SetColorFilter(ColorFilter)
Specify an optional color filter for the drawable.
[Android.Runtime.Register("setColorFilter", "(Landroid/graphics/ColorFilter;)V", "GetSetColorFilter_Landroid_graphics_ColorFilter_Handler")]
public abstract void SetColorFilter (Android.Graphics.ColorFilter? colorFilter);
[<Android.Runtime.Register("setColorFilter", "(Landroid/graphics/ColorFilter;)V", "GetSetColorFilter_Landroid_graphics_ColorFilter_Handler")>]
abstract member SetColorFilter : Android.Graphics.ColorFilter -> unit
Parameters
- colorFilter
- ColorFilter
The color filter to apply, or null
to remove the
existing color filter
- Attributes
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.
<p class="note"><strong>Note:</strong> Setting a non-null
color filter disables #setTintList(ColorStateList) tint
. </p>
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
SetColorFilter(Color, PorterDuff+Mode)
Specify a color and Porter-Duff mode to be the color filter for this drawable.
[Android.Runtime.Register("setColorFilter", "(ILandroid/graphics/PorterDuff$Mode;)V", "GetSetColorFilter_ILandroid_graphics_PorterDuff_Mode_Handler")]
public virtual void SetColorFilter (Android.Graphics.Color color, Android.Graphics.PorterDuff.Mode mode);
[<Android.Runtime.Register("setColorFilter", "(ILandroid/graphics/PorterDuff$Mode;)V", "GetSetColorFilter_ILandroid_graphics_PorterDuff_Mode_Handler")>]
abstract member SetColorFilter : Android.Graphics.Color * Android.Graphics.PorterDuff.Mode -> unit
override this.SetColorFilter : Android.Graphics.Color * Android.Graphics.PorterDuff.Mode -> unit
Parameters
- color
- Color
- mode
- PorterDuff.Mode
- Attributes
Remarks
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.