Ejemplo n.º 1
0
        private void CreateBlurredImage(ImageSource imageSource)
        {
            if (BlurredStrengh % 2 == 0 && BlurredStrengh != 0)
                throw new ArgumentException();

            if (ImageSource == null || _blurredImage == null)
                return;

            var bitmapImage = ((BitmapSource)imageSource);
            if (bitmapImage.PixelHeight == 0)
                return;

            WriteableBitmap writeableBmp = new WriteableBitmap(bitmapImage);
            if (BlurredStrengh > 0)
                writeableBmp.BoxBlur(BlurredStrengh);

            _blurredImage.Source = writeableBmp;

            SetOverlaySize();
            _rootGrid.Opacity = 1;
        }