I want to combine blur, Saturation and tint color.
I have a Blend effect, that consist of GaussianBlur and Tint color.
_compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;
var graphicsEffect = new BlendEffect
{
Mode = BlendEffectMode.Overlay,
Background = new GaussianBlurEffect()
{
Name = "Blur",
Source = new CompositionEffectSourceParameter("Backdrop"),
BlurAmount = 10f
BorderMode = EffectBorderMode.Hard,
},
Foreground = new ColorSourceEffect()
{
Name = "Tint",
Color = Color.FromArgb(120, 255, 255, 255),
}
};
var effectFactory = _compositor.CreateEffectFactory(graphicsEffect)
_brush = effectFactory.CreateBrush();
_brush.SetSourceParameter("Backdrop", _compositor.CreateBackdropBrush());
_effectSprite = _compositor.CreateSpriteVisual();
_effectSprite.Size = new Vector2((float)this.ActualWidth, (float)this.ActualHeight)
_effectSprite.Brush = _brush;
ElementCompositionPreview.SetElementChildVisual(this, _effectSprite)
How do I add SaturationEffect before or after this effect?
I've tried to wrap it into another BlendEffect and set another BackdropBrush as a source of the SaturationEffect, but I got white background only.
I've also tried to create brush from SaturationEffect and set it a a source of GaussianBlur, but I got exception "Invalid Source Brush"