add ColorComplementEffect

This commit is contained in:
NaBian committed 2019-12-14 01:33:32 +08:00
1 parent 94a1dbee42
commit f1dca283f8
7 files changed
+45

No files matched your search

@@ -0,0 +1,34 @@
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Effects;
namespace HandyControl.Media.Effects
{
public class ColorComplementEffect : ShaderEffect
{
public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(ColorComplementEffect), 0);
private static readonly PixelShader Shader;
static ColorComplementEffect()
{
Shader = new PixelShader
{
UriSource = new Uri("pack://application:,,,/HandyControl;component/Resources/Effects/ColorComplementEffect.ps")
};
}
public ColorComplementEffect()
{
PixelShader = Shader;
UpdateShaderValue(InputProperty);
}
public Brush Input
{
get => (Brush)GetValue(InputProperty);
set => SetValue(InputProperty, value);
}
}
}