KaleidoscopeEffect
Folds the picture into mirrored wedges round 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 pattern keeps its symmetry while the
picture sweeps through it. Choose SegmentCount rather than animate it – a change
re-cuts the wedges and reads as a jump.
Settings
| Property | Range and default |
|---|---|
Number of wedges. Default 6; values below 1 count as 1, a single mirror. | |
Turn of the fold, in radians. Default 0. | |
Point the wedges meet at, in relative coordinates: (0,0) is the top-left corner of the element and (1,1) its bottom-right. Default (0.5,0.5). |
Examples
<Image Source="Photos/flowers.jpg"
xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
<Image.Effect>
<fx:KaleidoscopeEffect SegmentCount="8" Rotation="0.4" />
</Image.Effect>
</Image>See also
Members at a glance
| Constructors | |
|---|---|
KaleidoscopeEffect | Creates the effect with its default settings: SegmentCount 6, Rotation
0, CenterXY (0.5,0.5). |
| Properties | |
CenterXY | Gets or sets the point the wedges meet at. |
Input | Gets or sets the picture the effect works on. |
Rotation | Gets or sets how far the fold is turned. |
SegmentCount | Gets or sets how many mirrored wedges the picture is folded into. |
| Fields | |
CenterXYProperty | Identifies the CenterXY dependency property. |
InputProperty | Identifies the Input dependency property. |
RotationProperty | Identifies the Rotation dependency property. |
SegmentCountProperty | Identifies the SegmentCount dependency property. |
Constructors
KaleidoscopeEffect
Creates the effect with its default settings: SegmentCount 6, Rotation
0, CenterXY (0.5,0.5).
Properties
CenterXY
Gets or sets the point the wedges meet at.
- Value
- A point in relative coordinates: (0,0) is the top-left corner of the element and (1,1) its bottom-right. The default is (0.5,0.5), the middle.
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.
Rotation
Gets or sets how far the fold is turned.
- Value
- In radians; the default is 0. Animate it to rotate the pattern.
SegmentCount
Gets or sets how many mirrored wedges the picture is folded into.
- Value
- The default is 6. Values below 1 count as 1, which gives a single mirror line through
CenterXY. Whole numbers give even wedges.
Fields
CenterXYProperty static
Identifies the CenterXY dependency property.
InputProperty static
Identifies the Input dependency property.
RotationProperty static
Identifies the Rotation dependency property.
SegmentCountProperty static
Identifies the SegmentCount dependency property.