private async void CreateBluredCoverArt(string coverArt) { var writeableBitmap = new WriteableBitmap(1, 1); var streamTask = coverArt == CoverArtPlaceholderLarge ? GetStreamFromFile(coverArt) : GetStreamFromUri(coverArt); using (var stream = await streamTask) { writeableBitmap = await writeableBitmap.FromStream(stream); } var bluredImage = writeableBitmap.Convolute(Gaussian11X11Kernel); BluredCoverArt = bluredImage; }
private async void CreateBluredCoverArt(string coverArt) { var dispatcher = Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher; await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => { var writeableBitmap = new WriteableBitmap(1, 1); var streamTask = coverArt == CoverArtPlaceholderLarge ? GetStreamFromFile(coverArt) : GetStreamFromUri(coverArt); using (var stream = await streamTask) { writeableBitmap = await writeableBitmap.FromStream(stream); var bluredImage = writeableBitmap.Convolute(Gaussian11X11Kernel); BluredCoverArt = bluredImage; } }); }