HypernovaDesktop Components · docs
Binarymission
WPFShaders Library › GlowingEdgesEffect

GlowingEdgesEffect

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

A pixel shader effect that finds the edges in its input and draws them back as a coloured glow over a darkened copy of the original.

public class GlowingEdgesEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

Every parameter has a working default, so dropping the effect on an element shows something immediately. Animate EdgeIntensity to make the outline pulse, or EdgeWidth to thicken and thin it.

Members at a glance

GlowingEdgesEffectInitializes a new instance of the GlowingEdgesEffect class.
EdgeColorThe colour the detected edges are drawn in.
EdgeIntensityHow strongly a detected edge glows. Zero leaves the input untouched; values above one push more of the picture into the glow.
EdgeWidthHow far apart the samples that detect an edge are taken, in texture coordinates, which is also how thick a detected edge looks. Useful range is about 0.001 to 0.02.
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.
EdgeColorPropertyIdentifies the EdgeColor dependency property.
EdgeIntensityPropertyIdentifies the EdgeIntensity dependency property.
EdgeWidthPropertyIdentifies the EdgeWidth dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

GlowingEdgesEffect

public GlowingEdgesEffect()

Initializes a new instance of the GlowingEdgesEffect class.

Properties

EdgeColor

public Color EdgeColor

The colour the detected edges are drawn in.

EdgeIntensity

public double EdgeIntensity

How strongly a detected edge glows. Zero leaves the input untouched; values above one push more of the picture into the glow.

EdgeWidth

public double EdgeWidth

How far apart the samples that detect an edge are taken, in texture coordinates, which is also how thick a detected edge looks. Useful range is about 0.001 to 0.02.

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.

Fields

EdgeColorProperty

public static readonly DependencyProperty EdgeColorProperty

Identifies the EdgeColor dependency property.

EdgeIntensityProperty

public static readonly DependencyProperty EdgeIntensityProperty

Identifies the EdgeIntensity dependency property.

EdgeWidthProperty

public static readonly DependencyProperty EdgeWidthProperty

Identifies the EdgeWidth dependency property.

InputProperty

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.