HypernovaDesktop Components · docs
Binarymission
WPFShaders Library › HexPixellateEffect

HexPixellateEffect

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

A pixel shader effect that quantises its input to a hexagonal grid rather than the square one PixellatingEffect uses.

public class HexPixellateEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

Each pixel takes the colour of the nearest hexagon centre. Animating HexSize from something small resolves the picture out of the mosaic, which demonstrates the effect better than any single size does.

Members at a glance

HexPixellateEffectInitializes a new instance of the HexPixellateEffect class.
HexSizeThe width of one hexagon in texture coordinates, so 0.04 gives about twenty-five hexagons across the element. Values below 0.002 are treated as 0.002.
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.
HexSizePropertyIdentifies the HexSize dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

HexPixellateEffect

public HexPixellateEffect()

Initializes a new instance of the HexPixellateEffect class.

Properties

HexSize

public double HexSize

The width of one hexagon in texture coordinates, so 0.04 gives about twenty-five hexagons across the element. Values below 0.002 are treated as 0.002.

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

HexSizeProperty

public static readonly DependencyProperty HexSizeProperty

Identifies the HexSize dependency property.

InputProperty

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.