使用WriteableBitmapEx在Windows运行时C#中模糊图像

时间:2015-07-01 22:27:27

标签: windows-phone-8 windows-runtime windows-phone-8.1

我试图在我的新Windows Phone Runtime C#app(WPRT)中模糊图像 我使用了WriteableBitmapEx NuGet和这段代码使我的图像模糊,但看不到我的图片中的任何变化。什么出错了?

public TestXaml()
    {
        this.InitializeComponent();
        ....
        test();
    }
async void test()
    {
        var ImgFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/TestBG.jpg"));
        var wb = new WriteableBitmap(100,100);
        using (var strm = await ImgFile.OpenReadAsync())
        {
            wb = await wb.FromStream(strm);
        }
        var wb3 = WriteableBitmapExtensions.Convolute(wb, WriteableBitmapExtensions.KernelGaussianBlur5x5);

        ImageBrush ib = new ImageBrush();
        ib.ImageSource = wb3;
        PageBackground.Background = ib;
    }

我也试过WriteableBitmapExtensions.KernelGaussianBlur3x3但仍然没有变化

0 个答案:

没有答案