HypernovaDesktop Components · docs
Binarymission
WPF › Shaders Library › TwirlEffect

TwirlEffect

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

Twists the middle of the picture round its centre, most at the centre and easing to nothing at the edge of a circle.

public class TwirlEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

Pixels outside Radius are left alone. The twist is always centred on the middle of the element. Animate Angle from 0 for a swirl-in transition.

Settings

PropertyRange and default

Radius

Size of the twisted circle, as a fraction of the element. Default 0.5; must be above 0.

Angle

Turn at the centre, in radians; negative twists the other way. Default 1.5.

Examples

<Image Source="Photos/harbour.jpg"
       xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
    <Image.Effect>
        <fx:TwirlEffect Radius="0.4" Angle="3" />
    </Image.Effect>
</Image>

See also

Members at a glance

Constructors
TwirlEffectCreates the effect with its default settings: Radius 0.5, Angle 1.5.
Properties
AngleGets or sets how far the twist turns.
InputGets or sets the picture the effect works on.
RadiusGets or sets how much of the picture is caught up in the twist.
Fields
AnglePropertyIdentifies the Angle dependency property.
InputPropertyIdentifies the Input dependency property.
RadiusPropertyIdentifies the Radius dependency property.

Constructors

TwirlEffect

public TwirlEffect()

Creates the effect with its default settings: Radius 0.5, Angle 1.5.

Properties

Angle

public double Angle

Gets or sets how far the twist turns.

Value
In radians at the centre, easing to nothing at Radius; the default is 1.5. A negative value twists the other way, and 0 leaves the picture unchanged.

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.

Radius

public double Radius

Gets or sets how much of the picture is caught up in the twist.

Value
The radius of the twisted circle round the middle of the element, as a fraction of its size; the default is 0.5. It must be greater than 0.

Fields

AngleProperty static

public static readonly DependencyProperty AngleProperty

Identifies the Angle dependency property.

InputProperty static

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.

RadiusProperty static

public static readonly DependencyProperty RadiusProperty

Identifies the Radius dependency property.