add ColorComplementEffect

This commit is contained in:
NaBian 2019-12-14 01:33:32 +08:00
parent 94a1dbee42
commit f1dca283f8
7 changed files with 45 additions and 0 deletions

View File

@ -56,5 +56,8 @@
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\dropper.cur">
<Link>Resources\dropper.cur</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\ColorComplementEffect.ps">
<Link>Resources\Effects\ColorComplementEffect.ps</Link>
</Resource>
</ItemGroup>
</Project>

View File

@ -108,6 +108,9 @@
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\dropper.cur">
<Link>Resources\dropper.cur</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\ColorComplementEffect.ps">
<Link>Resources\Effects\ColorComplementEffect.ps</Link>
</Resource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControl_Shared\HandyControl_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -179,6 +179,9 @@
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\dropper.cur">
<Link>Resources\dropper.cur</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\ColorComplementEffect.ps">
<Link>Resources\Effects\ColorComplementEffect.ps</Link>
</Resource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControl_Shared\HandyControl_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -58,6 +58,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Media\Animation\LinearGeometryKeyFrame.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Media\Animation\ResolvedKeyFrameEntry.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Media\Animation\SplineGeometryKeyFrame.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Media\Effects\ColorComplementEffect.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\BorderCircularClipConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\ColLayoutConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\CornerRadiusSplitConverter.cs" />

View File

@ -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);
}
}
}

View File

@ -22,6 +22,7 @@ using System.Runtime.InteropServices;
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Expression.Shapes")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Expression.Media")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Media.Animation")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Media.Effects")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Data")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Properties.Langs")]
[assembly: XmlnsPrefix("https://handyorg.github.io/handycontrol", "hc")]