HypernovaDesktop Components · docs
Binarymission
WPF › Shaders Library › RainFloorEffect

RainFloorEffect

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

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

PropertyRange and default

RainFloorActivityFactor

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
RainFloorEffectCreates the effect with its default settings: RainFloorActivityFactor 0.5.
Properties
InputGets or sets the picture the effect works on.
RainFloorActivityFactorGets or sets the position of the moving ring patterns; animate it to make the rain fall.
Fields
InputPropertyIdentifies the Input dependency property.
RainFloorActivityFactorPropertyIdentifies the RainFloorActivityFactor dependency property.

Constructors

RainFloorEffect

public RainFloorEffect()

Creates the effect with its default settings: RainFloorActivityFactor 0.5.

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.

RainFloorActivityFactor

public double 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

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.

RainFloorActivityFactorProperty static

public static readonly DependencyProperty RainFloorActivityFactorProperty

Identifies the RainFloorActivityFactor dependency property.