HypernovaDesktop Components · docs
Binarymission
WPFShaders 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

ColorToBlackAndWhiteEffectInitializes a new instance of the ColorToBlackAndWhiteEffect class.
DesaturationFactorHow far the color is drained, from 0 for the image untouched to 1 for full grayscale.
InputThe 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.
DesaturationFactorPropertyIdentifies the DesaturationFactor dependency property.
InputPropertyIdentifies 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.