diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
index 72bdb306..122ba525 100644
--- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
+++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
@@ -471,6 +471,12 @@
Resources\Img\cloud.png
+
+ Resources\Img\f.png
+
+
+ Resources\Img\b.png
+
diff --git a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
index d5a3a94b..1cc60b14 100644
--- a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
+++ b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
@@ -76,6 +76,9 @@
Resources\Effects\GrayScaleEffect.ps
+
+ Resources\Effects\MultiplyBlendEffect.ps
+
diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
index 50bbc0a2..8f01983d 100644
--- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
+++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
@@ -547,6 +547,12 @@
Resources\Img\cloud.png
+
+ Resources\Img\f.png
+
+
+ Resources\Img\b.png
+
diff --git a/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj b/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
index c593ae8c..33712056 100644
--- a/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
+++ b/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
@@ -128,6 +128,9 @@
Resources\Effects\GrayScaleEffect.ps
+
+ Resources\Effects\MultiplyBlendEffect.ps
+
diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
index abe74897..b6cecb03 100644
--- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
@@ -610,6 +610,12 @@
Resources\Img\cloud.png
+
+ Resources\Img\f.png
+
+
+ Resources\Img\b.png
+
diff --git a/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
index 9e873597..b0eec08e 100644
--- a/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
@@ -199,6 +199,9 @@
Resources\Effects\GrayScaleEffect.ps
+
+ Resources\Effects\MultiplyBlendEffect.ps
+
diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/b.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/b.png
new file mode 100644
index 00000000..a3cf8c17
Binary files /dev/null and b/src/Shared/HandyControlDemo_Shared/Resources/Img/b.png differ
diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/f.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/f.png
new file mode 100644
index 00000000..99597c0c
Binary files /dev/null and b/src/Shared/HandyControlDemo_Shared/Resources/Img/f.png differ
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Tools/EffectsDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Tools/EffectsDemoCtl.xaml
index 9bdf34d7..2bf916b7 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Tools/EffectsDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Tools/EffectsDemoCtl.xaml
@@ -25,75 +25,371 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index 01431223..6da6081b 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -68,6 +68,8 @@
+
+
@@ -972,7 +974,10 @@
+
+
+
diff --git a/src/Shared/HandyControl_Shared/Media/Effects/BlendEffect.cs b/src/Shared/HandyControl_Shared/Media/Effects/BlendEffect.cs
new file mode 100644
index 00000000..744affcc
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Media/Effects/BlendEffect.cs
@@ -0,0 +1,61 @@
+//reference doc : https://docs.microsoft.com/en-us/windows/win32/direct2d/blend#blending-examples
+
+using System;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Media;
+using System.Windows.Media.Effects;
+
+namespace HandyControl.Media.Effects
+{
+ public class BlendEffect : ShaderEffect
+ {
+ private static readonly Dictionary ShaderDic;
+
+ public static readonly DependencyProperty BackgroundProperty = RegisterPixelShaderSamplerProperty("Background", typeof(BlendEffect), 0);
+
+ public static readonly DependencyProperty ForegroundProperty = RegisterPixelShaderSamplerProperty("Foreground", typeof(BlendEffect), 1);
+
+ static BlendEffect()
+ {
+ ShaderDic = new Dictionary();
+ }
+
+ public BlendEffect()
+ {
+ if (!ShaderDic.ContainsKey(Mode))
+ {
+ ShaderDic[Mode] = new PixelShader
+ {
+ UriSource = new Uri($"pack://application:,,,/HandyControl;component/Resources/Effects/{Mode.ToString()}BlendEffect.ps")
+ };
+ }
+
+ PixelShader = ShaderDic[Mode];
+
+ UpdateShaderValue(BackgroundProperty);
+ UpdateShaderValue(ForegroundProperty);
+ }
+
+ public Brush Background
+ {
+ get => (Brush)GetValue(BackgroundProperty);
+ set => SetValue(BackgroundProperty, value);
+ }
+
+ public Brush Foreground
+ {
+ get => (Brush)GetValue(ForegroundProperty);
+ set => SetValue(ForegroundProperty, value);
+ }
+
+ public static readonly DependencyProperty ModeProperty = DependencyProperty.Register(
+ "Mode", typeof(BlendEffectMode), typeof(BlendEffect), new PropertyMetadata(default(BlendEffectMode), PixelShaderConstantCallback(0)));
+
+ public BlendEffectMode Mode
+ {
+ get => (BlendEffectMode) GetValue(ModeProperty);
+ set => SetValue(ModeProperty, value);
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Media/Effects/BlendEffectMode.cs b/src/Shared/HandyControl_Shared/Media/Effects/BlendEffectMode.cs
new file mode 100644
index 00000000..5c15ad70
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Media/Effects/BlendEffectMode.cs
@@ -0,0 +1,32 @@
+namespace HandyControl.Media.Effects
+{
+ public enum BlendEffectMode
+ {
+ Multiply,
+ Screen,
+ Darken,
+ Lighten,
+ Dissolve,
+ ColorBurn,
+ LinearBurn,
+ DarkerColor,
+ LighterColor,
+ ColorDodge,
+ LinearDodge,
+ Overlay,
+ SoftLight,
+ HardLight,
+ VividLight,
+ LinearLight,
+ PinLight,
+ HardMix,
+ Difference,
+ Exclusion,
+ Hue,
+ Saturation,
+ Color,
+ Luminosity,
+ Subtract,
+ Division
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Resources/Effects/ColorMatrixEffect.fx b/src/Shared/HandyControl_Shared/Resources/Effects/ColorMatrixEffect.fx
index 3f5142e4..f7c91008 100644
--- a/src/Shared/HandyControl_Shared/Resources/Effects/ColorMatrixEffect.fx
+++ b/src/Shared/HandyControl_Shared/Resources/Effects/ColorMatrixEffect.fx
@@ -46,11 +46,6 @@ float4 main(float2 uv : TEXCOORD) : COLOR
k, l, m, n,
p, q, r, s
};
-
- float4 matrixA2 =
- {
- e, j, o, t
- };
- return mul(matrixA1, color) + matrixA2;
+ return mul(matrixA1, color) + float4( e, j, o, t );
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Resources/Effects/MultiplyBlendEffect.fx b/src/Shared/HandyControl_Shared/Resources/Effects/MultiplyBlendEffect.fx
new file mode 100644
index 00000000..5a83692b
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Resources/Effects/MultiplyBlendEffect.fx
@@ -0,0 +1,15 @@
+sampler2D background : register(s0);
+sampler2D foreground : register(s1);
+
+float4 main(float2 uv : TEXCOORD) : COLOR
+{
+ float4 b = tex2D(background, uv);
+ float4 f = tex2D(foreground, uv);
+ float4 o = b;
+
+ f.rgb *= f.a;
+ b.rgb *= b.a;
+ o.rgb = f.rgb * b.rgb + f.rgb * (1 - b.a) + b.rgb * (1 - f.a);
+
+ return o;
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Resources/Effects/MultiplyBlendEffect.ps b/src/Shared/HandyControl_Shared/Resources/Effects/MultiplyBlendEffect.ps
new file mode 100644
index 00000000..c6b86762
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Effects/MultiplyBlendEffect.ps differ