private CompositionEffectBrush BuildBlurBrush()

in SamplesCommon/SamplesCommon/BackDrop.cs [159:196]


        private CompositionEffectBrush BuildBlurBrush()
        {
            Microsoft.Graphics.Canvas.Effects.GaussianBlurEffect blurEffect = new Microsoft.Graphics.Canvas.Effects.GaussianBlurEffect()
            {
                Name = "Blur",
                BlurAmount = 0.0f,
                BorderMode = Microsoft.Graphics.Canvas.Effects.EffectBorderMode.Hard,
                Optimization = Microsoft.Graphics.Canvas.Effects.EffectOptimization.Balanced,
                Source = new CompositionEffectSourceParameter("source"),
            };

            Microsoft.Graphics.Canvas.Effects.BlendEffect blendEffect = new Microsoft.Graphics.Canvas.Effects.BlendEffect
            {
                Background = blurEffect,
                Foreground = new Microsoft.Graphics.Canvas.Effects.ColorSourceEffect { Name = "Color", Color = Color.FromArgb(64, 255, 255, 255) },
                Mode = Microsoft.Graphics.Canvas.Effects.BlendEffectMode.SoftLight
            };

            Microsoft.Graphics.Canvas.Effects.SaturationEffect saturationEffect = new Microsoft.Graphics.Canvas.Effects.SaturationEffect
            {
                Source = blendEffect,
                Saturation = 1.75f,
            };

            Microsoft.Graphics.Canvas.Effects.BlendEffect finalEffect = new Microsoft.Graphics.Canvas.Effects.BlendEffect
            {
                Foreground = new CompositionEffectSourceParameter("NoiseImage"),
                Background = saturationEffect,
                Mode = Microsoft.Graphics.Canvas.Effects.BlendEffectMode.Screen,
            };

            var factory = Compositor.CreateEffectFactory(
                finalEffect,
                new[] { "Blur.BlurAmount", "Color.Color" }
                );

            return factory.CreateBrush();
        }