HypernovaDesktop Components · docs
Binarymission
WPFShaders Library › KaleidoscopeEffect

KaleidoscopeEffect

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

A pixel shader effect that folds its input into mirrored wedges around a centre point, the way a kaleidoscope folds whatever it is pointed at.

public class KaleidoscopeEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

Animate Rotation to turn the barrel; the picture keeps its symmetry while the content sweeps through it. SegmentCount is settable at any time but is meant to be chosen rather than animated - changing it mid-animation re-cuts the wedges and reads as a jump.

Members at a glance

KaleidoscopeEffectInitializes a new instance of the KaleidoscopeEffect class.
CenterXYThe point the wedges radiate from, in texture coordinates, where (0,0) is the top left of the element and (1,1) the bottom right.
InputThe image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.
RotationHow far the fold is turned, in radians. Animate this to rotate the pattern.
SegmentCountHow many mirrored wedges the picture is folded into. Values below one are treated as one, which leaves the input unfolded.
CenterXYPropertyIdentifies the CenterXY dependency property.
InputPropertyIdentifies the Input dependency property.
RotationPropertyIdentifies the Rotation dependency property.
SegmentCountPropertyIdentifies the SegmentCount dependency property.

Constructors

KaleidoscopeEffect

public KaleidoscopeEffect()

Initializes a new instance of the KaleidoscopeEffect class.

Properties

CenterXY

public Point CenterXY

The point the wedges radiate from, in texture coordinates, where (0,0) is the top left of the element and (1,1) the bottom right.

Input

public Brush Input

The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.

Rotation

public double Rotation

How far the fold is turned, in radians. Animate this to rotate the pattern.

SegmentCount

public double SegmentCount

How many mirrored wedges the picture is folded into. Values below one are treated as one, which leaves the input unfolded.

Fields

CenterXYProperty

public static readonly DependencyProperty CenterXYProperty

Identifies the CenterXY dependency property.

InputProperty

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.

RotationProperty

public static readonly DependencyProperty RotationProperty

Identifies the Rotation dependency property.

SegmentCountProperty

public static readonly DependencyProperty SegmentCountProperty

Identifies the SegmentCount dependency property.