RainFloorEffect
Ripples the picture with overlapping rings, like rain falling on a wet floor or a puddle.
public class RainFloorEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Remarks
The rings come from three points, and RainFloorActivityFactor moves two of them;
animate it continuously to make the rings drift as rain does. How far the picture is displaced is
fixed, at about two per cent of its size.
Settings
| Property | Range and default |
|---|---|
Moves the ring patterns; any value. Default 0.5. |
Examples
Rain that keeps falling.
<Image Source="Photos/street.jpg"
xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
<Image.Effect>
<fx:RainFloorEffect x:Name="Rain" />
</Image.Effect>
<Image.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Rain" Storyboard.TargetProperty="RainFloorActivityFactor"
From="0" To="1" Duration="0:0:6" AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>See also
Members at a glance
| Constructors | |
|---|---|
RainFloorEffect | Creates the effect with its default settings: RainFloorActivityFactor 0.5. |
| Properties | |
Input | Gets or sets the picture the effect works on. |
RainFloorActivityFactor | Gets or sets the position of the moving ring patterns; animate it to make the rain fall. |
| Fields | |
InputProperty | Identifies the Input dependency property. |
RainFloorActivityFactorProperty | Identifies the RainFloorActivityFactor dependency property. |
Constructors
RainFloorEffect
Creates the effect with its default settings: RainFloorActivityFactor 0.5.
Properties
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.
RainFloorActivityFactor
Gets or sets the position of the moving ring patterns; animate it to make the rain fall.
- Value
- Any value; the default is 0.5. Changing it slides two of the three ring centres across the picture, so a steady animation over 0 to 1 gives drifting rings.
Fields
InputProperty static
Identifies the Input dependency property.
RainFloorActivityFactorProperty static
Identifies the RainFloorActivityFactor dependency property.