I try to apply several filters to a picture with the Lumia Imaging SDK, but I can only do it with 1 filter. When I made it for Win 8.1, I could use an array of filters, but now it doesn't work. How I can resolve it?
Code for apply filter:
public async Task<bool> ApplyEffectAsync(StorageFile file)
{
WriteableBitmap temp = new WriteableBitmap(1280, 720);
temp = new WriteableBitmap(1280, 720);
FileStream = await File.OpenAsync(FileAccessMode.Read);
temp.SetSource(FileStream);
OriginalPicture = temp;
FileStream.Seek(0);
original.Invalidate();
((IImageConsumer) Effect).Source = new RandomAccessStreamImageSource(FileStream);
M_renderer = new WriteableBitmapRenderer((IImageProvider)Effect, original);
FilteringPicture = await M_renderer.RenderAsync();
filtering.Invalidate();
return true;
}
I don't quite understand how you did this in Win 8.1 app, but in UWP apps, if you want to apply multiple Effects on the image, you can set the last rendered source of effect as the new source of another filter. Just for example here:
Code behind: