RadialBlurEffect
Streaks the picture towards a centre point – the blur a camera leaves when it zooms during the exposure.
public class RadialBlurEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Remarks
Twelve samples are taken for each pixel, enough to read as a streak without banding at the
strengths the effect is meant for. Animate BlurAmount down to zero for a zoom-in
transition; move CenterXY to throw the streak off-centre.
Settings
| Property | Range and default |
|---|---|
Length of the streak, as a fraction of each pixel's distance from the centre. Default 0.2; 0 leaves the picture unchanged, 0.05 to 0.5 is the useful range. | |
Point the streaks converge on, 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
A page that zooms into focus as it appears.
<Grid xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
<Grid.Effect>
<fx:RadialBlurEffect x:Name="Zoom" BlurAmount="0.6" />
</Grid.Effect>
<Grid.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Zoom" Storyboard.TargetProperty="BlurAmount"
To="0" Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Grid.Triggers>
<!-- the page's content -->
</Grid>See also
Members at a glance
| Constructors | |
|---|---|
RadialBlurEffect | Creates the effect with its default settings: BlurAmount 0.2, CenterXY
(0.5,0.5). |
| Properties | |
BlurAmount | Gets or sets how long the streaks are. |
CenterXY | Gets or sets the point the streaks converge on. |
Input | Gets or sets the picture the effect works on. |
| Fields | |
BlurAmountProperty | Identifies the BlurAmount dependency property. |
CenterXYProperty | Identifies the CenterXY dependency property. |
InputProperty | Identifies the Input dependency property. |
Constructors
RadialBlurEffect
Creates the effect with its default settings: BlurAmount 0.2, CenterXY
(0.5,0.5).
Properties
BlurAmount
Gets or sets how long the streaks are.
- Value
- A fraction of each pixel's distance from
CenterXY: 1 streaks all the way to it. The default is 0.2; 0 leaves the picture unchanged, 0.05 to 0.5 is the useful range, and a negative value streaks outwards instead.
CenterXY
Gets or sets the point the streaks converge on.
- 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.
Fields
BlurAmountProperty static
Identifies the BlurAmount dependency property.
CenterXYProperty static
Identifies the CenterXY dependency property.
InputProperty static
Identifies the Input dependency property.