GlowingEdgesEffect
Finds the edges in the picture – outlines, text, the borders between colours – and draws them in a glowing colour, leaving flat areas as they were.
public class GlowingEdgesEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Remarks
Every setting has a working default, so the effect shows something as soon as it is applied.
Animate EdgeIntensity to make the outline pulse – on a button the pointer is over, say
- or EdgeWidth to thicken and thin it.
Settings
| Property | Range and default |
|---|---|
Thickness of the outline, as a fraction of the element. Default 0.0025; 0.001 to 0.02 is the useful range. | |
How strongly edges glow. Default 2; 0 leaves the picture unchanged. | |
Colour of the glow. Default cyan. |
Examples
<Image Source="Images/logo.png"
xmlns:fx="clr-namespace:Binarymission.WPF.Shaders.Library.CustomEffects;assembly=Binarymission.WPF.Shaders.Library">
<Image.Effect>
<fx:GlowingEdgesEffect EdgeColor="Gold" EdgeIntensity="3" />
</Image.Effect>
</Image>See also
Members at a glance
| Constructors | |
|---|---|
GlowingEdgesEffect | Creates the effect with its default settings: EdgeWidth 0.0025,
EdgeIntensity 2, EdgeColor cyan. |
| Properties | |
EdgeColor | Gets or sets the colour the edges glow in. |
EdgeIntensity | Gets or sets how strongly the edges glow. |
EdgeWidth | Gets or sets how thick the glowing outline is. |
Input | Gets or sets the picture the effect works on. |
| Fields | |
EdgeColorProperty | Identifies the EdgeColor dependency property. |
EdgeIntensityProperty | Identifies the EdgeIntensity dependency property. |
EdgeWidthProperty | Identifies the EdgeWidth dependency property. |
InputProperty | Identifies the Input dependency property. |
Constructors
GlowingEdgesEffect
Creates the effect with its default settings: EdgeWidth 0.0025,
EdgeIntensity 2, EdgeColor cyan.
Properties
EdgeColor
Gets or sets the colour the edges glow in.
- Value
- The default is
Colors.Cyan. Its alpha is not used.
EdgeIntensity
Gets or sets how strongly the edges glow.
- Value
- The default is 2. 0 leaves the picture unchanged, and higher values turn fainter edges into glow as well. A negative value counts as 0.
EdgeWidth
Gets or sets how thick the glowing outline is.
- Value
- The distance across which an edge is looked for, as a fraction of the element's size; the default is 0.0025 and 0.001 to 0.02 is the useful range. Values at or below 0 are treated as a hair's width.
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
EdgeColorProperty static
Identifies the EdgeColor dependency property.
EdgeIntensityProperty static
Identifies the EdgeIntensity dependency property.
EdgeWidthProperty static
Identifies the EdgeWidth dependency property.
InputProperty static
Identifies the Input dependency property.