c# - Nokia Imaging SDK 1.2: Applying filter to WriteableBitmap -


i've been trying apply filter nokias imaging sdk writeablebitmap. far, didn't have success. "best" got following, 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 writeablebitmap), provided writeablebitmapex library.

has had same problem?

you getting exception in renderer.renderasync() because aren't setting writeablebitmap property of writeablebitmaprenderer.

the writeablebitmaprenderer can not create writeablebitmap you, needs created on ui thread. must create , pass renderer object (either in constructor or setting property).


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -