예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            var screenwidth  = (SystemParameters.PrimaryScreenWidth);
            var screenheight = (SystemParameters.PrimaryScreenHeight);

            wallpaper_instance.Source = Screenshot.CopyScreen();
            wallpaper_instance.Width  = screenwidth;
            wallpaper_instance.Height = screenheight;
            RenderOptions.SetBitmapScalingMode(wallpaper_instance, BitmapScalingMode.LowQuality);

            canvas.Children.Add(wallpaper_instance);

            BlurBitmapEffect myBlurEffect = new BlurBitmapEffect();

            // Set the Radius property of the blur. This determines how
            // blurry the effect will be. The larger the radius, the more
            // blurring.
            myBlurEffect.Radius = 15;

            // Set the KernelType property of the blur. A KernalType of "Box"
            // creates less blur than the Gaussian kernal type.
            myBlurEffect.KernelType = KernelType.Box;

            // Apply the bitmap effect to the Button.
            wallpaper_instance.BitmapEffect = myBlurEffect;
        }