I've been trying to apply a filter from Nokias Imaging SDK to a WriteableBitmap. So far, I didn't have any success. The "best" I got is the following, which crashes on renderer.RenderAsync()
MemoryStream stream = new MemoryStream(App.MainViewModel.Current.Album.Cover.ToByteArray());
StreamImageSource streamImage = new StreamImageSource(stream);
FilterEffect filters = new FilterEffect(streamImage);
WriteableBitmapRenderer renderer = new WriteableBitmapRenderer(filters);
BlurFilter blurFilter = new BlurFilter();
filters.Filters = new[] { blurFilter };
var result = await renderer.RenderAsync();
The ToByteArray()
extension method on Cover (which is a WriteableBitmap
), is provided by the WriteableBitmapEx library.
Has anyone had the same problem?