HypernovaDesktop Components · docs
Binarymission
WPF › Shaders Library › BandsEffect

BandsEffect

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

Lays evenly spaced vertical stripes over the picture, each shading from darker on its left to brighter on its right – a scan-line or slatted-blind look.

public class BandsEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

The stripes run from top to bottom and repeat across the width. Within each stripe the brightness change grows steeply towards its edges, so neighbouring stripes meet at a crisp line.

Settings

PropertyRange and default

BandDensity

How many stripes: about BandDensity divided by pi across the element. Default 160 (about 51 stripes); 0 gives none.

BandIntensity

How strongly each stripe lightens and darkens. Default 0.35; 0 leaves the picture unchanged, and 0.05 to 0.5 is the useful range.

Examples

<Image Source="Photos/harbour.jpg"
       xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
    <Image.Effect>
        <fx:BandsEffect BandDensity="300" BandIntensity="0.08" />
    </Image.Effect>
</Image>

See also

Members at a glance

Constructors
BandsEffectCreates the effect with its default settings: BandDensity 160, BandIntensity 0.35.
Properties
BandDensityGets or sets how closely the stripes are packed across the picture.
BandIntensityGets or sets how strongly each stripe lightens and darkens the picture.
InputGets or sets the picture the effect works on.
Fields
BandDensityPropertyIdentifies the BandDensity dependency property.
BandIntensityPropertyIdentifies the BandIntensity dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

BandsEffect

public BandsEffect()

Creates the effect with its default settings: BandDensity 160, BandIntensity 0.35.

Properties

BandDensity

public double BandDensity

Gets or sets how closely the stripes are packed across the picture.

Value
About this value divided by pi stripes across the element. The default is 160, about 51 stripes; 0 gives none, and a negative value mirrors the shading.

BandIntensity

public double BandIntensity

Gets or sets how strongly each stripe lightens and darkens the picture.

Value
The default is 0.35. 0 leaves the picture unchanged; 0.05 to 0.5 is the useful range.

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

BandDensityProperty static

public static readonly DependencyProperty BandDensityProperty

Identifies the BandDensity dependency property.

BandIntensityProperty static

public static readonly DependencyProperty BandIntensityProperty

Identifies the BandIntensity dependency property.

InputProperty static

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.