HypernovaDesktop Components · docs
Binarymission
WPF › Shaders Library › NegativeToPositiveEffect

NegativeToPositiveEffect

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

Inverts the colours of the picture – black to white, blue to yellow – turning a scanned negative into a positive, or a positive into a negative.

public class NegativeToPositiveEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

Transparency is kept: a semi-transparent pixel is inverted within its own opacity, so edges stay clean. The effect has no settings.

Examples

<Image Source="Scans/film-strip-07.png"
       xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
    <Image.Effect>
        <fx:NegativeToPositiveEffect />
    </Image.Effect>
</Image>

See also

Members at a glance

Constructors
NegativeToPositiveEffectCreates the effect.
Properties
InputGets or sets the picture the effect works on.
Fields
InputPropertyIdentifies the Input dependency property.

Constructors

NegativeToPositiveEffect

public NegativeToPositiveEffect()

Creates the effect.

Properties

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

InputProperty static

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.