BandsEffect
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
| Property | Range and default |
|---|---|
How many stripes: about | |
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 | |
|---|---|
BandsEffect | Creates the effect with its default settings: BandDensity 160,
BandIntensity 0.35. |
| Properties | |
BandDensity | Gets or sets how closely the stripes are packed across the picture. |
BandIntensity | Gets or sets how strongly each stripe lightens and darkens the picture. |
Input | Gets or sets the picture the effect works on. |
| Fields | |
BandDensityProperty | Identifies the BandDensity dependency property. |
BandIntensityProperty | Identifies the BandIntensity dependency property. |
InputProperty | Identifies the Input dependency property. |
Constructors
BandsEffect
Creates the effect with its default settings: BandDensity 160,
BandIntensity 0.35.
Properties
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
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
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
Identifies the BandDensity dependency property.
BandIntensityProperty static
Identifies the BandIntensity dependency property.
InputProperty static
Identifies the Input dependency property.