WPF › Shaders Library › ColorToBlackAndWhiteEffect
ColorToBlackAndWhiteEffect
class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Shaders.Library.CustomEffects
A pixel shader effect that drains color from its input. The desaturation factor controls how far towards grayscale it goes.
public class ColorToBlackAndWhiteEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Members at a glance
ColorToBlackAndWhiteEffect | Initializes a new instance of the ColorToBlackAndWhiteEffect class. |
DesaturationFactor | How far the color is drained, from 0 for the image untouched to 1 for full grayscale. |
Input | The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush. |
DesaturationFactorProperty | Identifies the DesaturationFactor dependency property. |
InputProperty | Identifies the Input dependency property. |
Constructors
ColorToBlackAndWhiteEffect
public ColorToBlackAndWhiteEffect()
Initializes a new instance of the ColorToBlackAndWhiteEffect class.
Properties
DesaturationFactor
public double DesaturationFactor
How far the color is drained, from 0 for the image untouched to 1 for full grayscale.
Input
public Brush Input
The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.
Fields
DesaturationFactorProperty
public static readonly DependencyProperty DesaturationFactorProperty
Identifies the DesaturationFactor dependency property.
InputProperty
public static readonly DependencyProperty InputProperty
Identifies the Input dependency property.