I'm working on an imaging app using the nokia imaging SDK 1.1. A task seeming fairly simple (let the user choose an image and apply some filters to it) currently blocks me, for 2 days now. I've written hundreds of lines and reviewd all the Nokia Dev Samples (which, most of the time, are very well-strcutured, but too complex for an imaging SDK starter like me) but I always get the following exception:
{System.NullReferenceException: Invalid pointer at Nokia.Graphics.Imaging.BitmapRenderer.RenderAsync()
This is the code (I've reduced the part where the filters are passed so just an empty FilterEffect is passed on for simplicity):
PhotoChooserTask task = new PhotoChooserTask();
task.Completed += async (result,choosen) =>
{
Stream stream = choosen.ChosenPhoto;
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(stream);
WriteableBitmap bitmap = new WriteableBitmap(bitmapImage);
WriteableBitmapRenderer renderer = new WriteableBitmapRenderer(new FilterEffect(), bitmap, OutputOption.PreserveAspectRatio);
await renderer.RenderAsync();
};
task.ShowCamera = true;
task.Show();
So if I understood everything well, the app is crashing because some kind of invalid pointer is passed on, but the bitmap it valid - or at least the size of it is correct, so I guess, the data has been passed on, as well.
Anyway, here is the stacktrace
at Nokia.Graphics.Imaging.BitmapRenderer.RenderAsync()
at Nokia.Graphics.Imaging.WriteableBitmapRenderer.<<RenderAsync>b__0>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at RealtimeFilterDemo.MainPage.<<ShutterButton_Tap>b__1a>d__1c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)