HypernovaDesktop Components · docs
Binarymission
WPF › Shaders Library › PositiveEffect

PositiveEffect

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

Looks at the picture through a coloured filter: each colour channel is multiplied by the matching channel of ColorFilter.

public class PositiveEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

White, the default, changes nothing; a pale amber warms the picture, and pure red keeps only its red channel. A filter can only take colour away, never add it – to tint towards a colour, see ColorBlendEffect.

Settings

PropertyRange and default

ColorFilter

The filter colour; its alpha is not used. Default white.

Examples

<Image Source="Photos/harbour.jpg"
       xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
    <Image.Effect>
        <fx:PositiveEffect ColorFilter="#FFFFE2B8" />
    </Image.Effect>
</Image>

See also

Members at a glance

Constructors
PositiveEffectCreates the effect with its default settings: ColorFilter white, which changes nothing.
Properties
ColorFilterGets or sets the colour of the filter the picture is seen through.
InputGets or sets the picture the effect works on.
Fields
ColorFilterPropertyIdentifies the ColorFilter dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

PositiveEffect

public PositiveEffect()

Creates the effect with its default settings: ColorFilter white, which changes nothing.

Properties

ColorFilter

public Color ColorFilter

Gets or sets the colour of the filter the picture is seen through.

Value
Each channel of the picture is multiplied by the matching channel of this colour; its alpha is not used. The default is Colors.White, which leaves the picture unchanged.

Input

public 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

ColorFilterProperty static

public static readonly DependencyProperty ColorFilterProperty

Identifies the ColorFilter dependency property.

InputProperty static

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.