DuotoneEffect
A pixel shader effect that maps the brightness of its input onto a two-colour ramp - the darkest pixels become ShadowColor, the brightest HighlightColor, and everything else a blend of the two.
public class DuotoneEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Remarks
The brightness is measured on the straight colour rather than the premultiplied one WPF hands the shader, so semi-transparent pixels map where they look as though they should. Strength mixes the result back towards the original, so the effect can be dialled in rather than only switched on.
Members at a glance
DuotoneEffect | Initializes a new instance of the DuotoneEffect class. |
HighlightColor | The colour the brightest pixels are mapped to. |
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. |
ShadowColor | The colour the darkest pixels are mapped to. |
Strength | How far the ramp replaces the original colour, from 0 (unchanged) to 1 (fully duotone). |
HighlightColorProperty | Identifies the HighlightColor dependency property. |
InputProperty | Identifies the Input dependency property. |
ShadowColorProperty | Identifies the ShadowColor dependency property. |
StrengthProperty | Identifies the Strength dependency property. |
Constructors
DuotoneEffect
Initializes a new instance of the DuotoneEffect class.
Properties
HighlightColor
The colour the brightest pixels are mapped to.
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.
ShadowColor
The colour the darkest pixels are mapped to.
Strength
How far the ramp replaces the original colour, from 0 (unchanged) to 1 (fully duotone).
Fields
HighlightColorProperty
Identifies the HighlightColor dependency property.
InputProperty
Identifies the Input dependency property.
ShadowColorProperty
Identifies the ShadowColor dependency property.
StrengthProperty
Identifies the Strength dependency property.