I'm using Lumia Imaging SDK 2.0 for this app.
Basically I've created a Rectangle for a specific filter. When user taps the Rectangle, that filter will be applied to it.
But my problem is: When user taps other filters, the previous filters do not wear off. I want to make sure that filter will be applied permanently only when user double taps the Rectangle but when he single taps, the filter effect will be applied to the photo temporarily to preview the effect. When he selects other filter, previous filter will wear off. I hope I made myself clear.
Here's the code of what I'm doing:
private async void RecAntiqueFilter_Tapped(object sender, DoubleTappedRoutedEventArgs e)
{
var imageStream = new BitmapImageSource(originalBitmap.AsBitmap());
using (var effect = new FilterEffect(imageStream))
{
var filter = new AntiqueFilter();
effect.Filters = new[] { filter };
// Render the image to a WriteableBitmap.
var renderer = new WriteableBitmapRenderer(effect, originalBitmap);
editedBitmap = await renderer.RenderAsync();
editedBitmap.Invalidate();
}
Image.Source = editedBitmap;
}
And one more thing, how will I implement undo filter option?