Esempio n. 1
0
        public static WriteableBitmap WriteableBitmapBlur(this WriteableBitmap writeableBitmapOld, KernelType kernelType = KernelType.KernelGaussianBlur5x5)
        {
            //var cloneWriteableBitmap = WriteableBitmapExpansions.CopyWriteableBitmap(writeableBitmapOld);
            var kernelValue = 5;

            kernelValue = ConverKernelValue(kernelType);
            WriteableBitmap writeableBitmapBlur = WriteableBitmapExtensions.Convolute(writeableBitmapOld, ConverKernelType(kernelType), kernelValue, kernelValue);

            writeableBitmapBlur.Invalidate();
            return(writeableBitmapBlur);
        }
Esempio n. 2
0
        public static WriteableBitmap WriteableBitmapBlur(this WriteableBitmap writeableBitmapOld, int[,] GaussianBlur, int kernelFactorSum, int kernelOffsetSum)
        {
            //var cloneWriteableBitmap = WriteableBitmapExpansions.CopyWriteableBitmap(writeableBitmapOld);
            WriteableBitmap writeableBitmapBlur = null;

            if (GaussianBlur == null)
            {
                writeableBitmapBlur = WriteableBitmapExtensions.Convolute(writeableBitmapOld, WriteableBitmapExtensions.KernelGaussianBlur5x5, 5, 5);
            }
            else
            {
                writeableBitmapBlur = WriteableBitmapExtensions.Convolute(writeableBitmapOld, GaussianBlur, kernelFactorSum, kernelOffsetSum);
            }
            writeableBitmapBlur.Invalidate();
            return(writeableBitmapBlur);
        }