HypernovaDesktop Components · docs
Binarymission
WPF › Shaders Library › ColorBlendEffect

ColorBlendEffect

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Shaders.Library.CustomEffects

Washes the picture with a colour, as strongly as the colour's alpha says – from no change at all to the colour alone.

public class ColorBlendEffect : System.Windows.Media.Effects.ShaderEffect

Inherits from / implements: System.Windows.Media.Effects.ShaderEffect

Remarks

Use a part-transparent colour to tint: a warm wash over a photograph, a red cast over a control that needs attention. The colour covers the whole of the element, transparent parts included.

Settings

PropertyRange and default

BlendColor

The colour, and through its alpha how much of it: 0 changes nothing, 255 replaces the picture. Default transparent black (#00000000).

Examples

<Image Source="Photos/harbour.jpg"
       xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
    <Image.Effect>
        <fx:ColorBlendEffect BlendColor="#60FF8C00" />
    </Image.Effect>
</Image>

See also

Members at a glance

Constructors
ColorBlendEffectCreates the effect with its default settings: BlendColor transparent, which changes nothing.
Properties
BlendColorGets or sets the colour washed over the picture; its alpha sets how strongly.
InputGets or sets the picture the effect works on.
Fields
BlendColorPropertyIdentifies the BlendColor dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

ColorBlendEffect

public ColorBlendEffect()

Creates the effect with its default settings: BlendColor transparent, which changes nothing.

Properties

BlendColor

public virtual System.Windows.Media.Color BlendColor

Gets or sets the colour washed over the picture; its alpha sets how strongly.

Value
The default is transparent black, #00000000, which changes nothing. An alpha of 255 replaces the picture with the colour; #60FF8C00 is a light orange wash.

Input

public virtual System.Windows.Media.Brush Input

Gets or sets the picture the effect works on.

Value
A brush. The default is the element the effect is applied to, as WPF renders it – the effect's implicit input.
Remarks

Leave it unset in the usual case, where the effect is set as an element's Effect. Set it to a ImageBrush or VisualBrush to have the effect work on that picture instead.

Fields

BlendColorProperty static

public static readonly DependencyProperty BlendColorProperty

Identifies the BlendColor dependency property.

InputProperty static

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.