windowcapture
исходный код / Helpers/BlurHelper.cs

BlurHelper.cs

23 строк · 621 байт · модуль Helpers
 1using System;
 2using WindowCapture.Models;
 3using WindowCapture.Native;
 4
 5namespace WindowCapture.Helpers
 6{
 7    public static class BlurHelper
 8    {
 9        public static void Apply(IntPtr hwnd)
10        {
11            try
12            {
13                int tint = ColorHelper.ToABGR(Settings.BlurTintAlpha, Settings.BlurTintColor);
14                // Windows 10 DWM doesn't update GradientColor on re-call.
15                // Must disable first, then re-enable with new tint.
16                WinApi.DisableBlur(hwnd);
17                WinApi.EnableBlurBehind(hwnd, tint);
18            }
19            catch { }
20        }
21
22    }
23}