It’s been a while since the last post on the ImageEditor for Windows Phone. For those who haven't played with UI for Windows Phone 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 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.
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.
Improving the ColorEffects tool
Changing the final result of the image happens in the OnIsInvertedChanged(...), OnIsGrayScaleChanged(...) and OnIsColorFixedChanged(...) overrides.
Create Sketch Effect
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 either ImageEditorTool
and override ApplyCore(...)
to render the desired output.
Adding the two new effects can happen either through XAML or in the code-behind.
Feel free to share your experience with the Nokia Imaging SDK and our tools. The source code of the app used in this article is available on github.
: Telerik Image Editor for Windows Phone
: UI for Windows Phone
: Nokia Imaging SDK