WaterWaveEffect
Wobbles the picture in fine waves across and down it, as if seen through moving water or heat haze.
public class WaterWaveEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Remarks
There are about thirty waves across the element. WaveFactor sets how far they
push the picture; animate it to make the picture swell and settle. ColorFilter is
accepted but is not used by the shader, so it does not change the picture.
Settings
| Property | Range and default |
|---|---|
How far the waves displace the picture, as a fraction of the element. Default 0.03; 0 leaves it unchanged, 0.002 to 0.03 is the useful range. | |
Not used by the shader. Default yellow. |
Examples
A gentle, continuous shimmer.
<Image Source="Photos/lake.jpg"
xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
<Image.Effect>
<fx:WaterWaveEffect x:Name="Haze" WaveFactor="0" />
</Image.Effect>
<Image.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Haze" Storyboard.TargetProperty="WaveFactor"
To="0.006" Duration="0:0:2" AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>See also
Members at a glance
| Constructors | |
|---|---|
WaterWaveEffect | Creates the effect with its default settings: WaveFactor 0.03. |
| Properties | |
ColorFilter | Gets or sets a tint colour that the shader does not use. |
Input | Gets or sets the picture the effect works on. |
WaveFactor | Gets or sets how strongly the waves displace the picture. |
| Fields | |
ColorFilterProperty | Identifies the ColorFilter dependency property. |
InputProperty | Identifies the Input dependency property. |
WaveFactorProperty | Identifies the WaveFactor dependency property. |
Constructors
WaterWaveEffect
Creates the effect with its default settings: WaveFactor 0.03.
Properties
ColorFilter
Gets or sets a tint colour that the shader does not use.
- Value
- The default is
Colors.Yellow. Setting it has no visible effect.
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.
WaveFactor
Gets or sets how strongly the waves displace the picture.
- Value
- A fraction of the element's size; the default is 0.03, a strong wobble. 0 leaves the picture unchanged, and 0.002 to 0.03 is the useful range.
Fields
ColorFilterProperty static
Identifies the ColorFilter dependency property.
InputProperty static
Identifies the Input dependency property.
WaveFactorProperty static
Identifies the WaveFactor dependency property.