HypernovaDesktop Components · docs
Binarymission
WPF › Shaders Library › GlowingEdgesEffect

GlowingEdgesEffect

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

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

PropertyRange and default

EdgeWidth

Thickness of the outline, as a fraction of the element. Default 0.0025; 0.001 to 0.02 is the useful range.

EdgeIntensity

How strongly edges glow. Default 2; 0 leaves the picture unchanged.

EdgeColor

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
GlowingEdgesEffectCreates the effect with its default settings: EdgeWidth 0.0025, EdgeIntensity 2, EdgeColor cyan.
Properties
EdgeColorGets or sets the colour the edges glow in.
EdgeIntensityGets or sets how strongly the edges glow.
EdgeWidthGets or sets how thick the glowing outline is.
InputGets or sets the picture the effect works on.
Fields
EdgeColorPropertyIdentifies the EdgeColor dependency property.
EdgeIntensityPropertyIdentifies the EdgeIntensity dependency property.
EdgeWidthPropertyIdentifies the EdgeWidth dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

GlowingEdgesEffect

public GlowingEdgesEffect()

Creates the effect with its default settings: EdgeWidth 0.0025, EdgeIntensity 2, EdgeColor cyan.

Properties

EdgeColor

public Color EdgeColor

Gets or sets the colour the edges glow in.

Value
The default is Colors.Cyan. Its alpha is not used.

EdgeIntensity

public double 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

public double 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

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.

Fields

EdgeColorProperty static

public static readonly DependencyProperty EdgeColorProperty

Identifies the EdgeColor dependency property.

EdgeIntensityProperty static

public static readonly DependencyProperty EdgeIntensityProperty

Identifies the EdgeIntensity dependency property.

EdgeWidthProperty static

public static readonly DependencyProperty EdgeWidthProperty

Identifies the EdgeWidth dependency property.

InputProperty static

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.