It’s been a while since the last post on the ImageEditor for Windows Phone[0]. For those who haven't played with UI for Windows Phone[1] yet, the Image Editor is a tool that enables in-app image editing which is particularly if you want to enable user to edit and save images without leaving your app. The Image Editor has a wide range of in-built functionalities but also provides extension points which can be used, for example to create new effects or modify the default ones. The Nokia Imaging SDK[2] contains a great selection of image-manipulation tools which can be integrated in the Image Editor quite fast.



In this post you’ll see how to improve the performance of an effect that is already built into the ImageEditor and also create a new effect that turns images into sketches.

Improving the ColorEffects tool

The ColorEffects tool is part of the Image Editor and allows you to apply greyscale, invert or auto-fix the colors of an image. The most important properties are IsColorFixed , IsGreyscale and IsColorInverted, and only one can be set to "true" at a given time.



Changing the final result of the image happens in the OnIsInvertedChanged(...), OnIsGrayScaleChanged(...) and OnIsColorFixedChanged(...) overrides.

Create Sketch Effect

Adding the two new effects can happen either through XAML or in the code-behind.









The second part of this article focuses on creating a new tool for the Image Editor that turns an image into a sketch, again using the algorithms that are part of the Nokia SDK. The tool should also allow for switching between gray and color sketch mode.The fastest way to implement a new tool is to inherit it from eitherorand overrideto render the desired output.