O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recoloring an image

Sometimes it is necessary to perform modifications on the image based on the values of particular pixels. Of course, this is possible, and you will learn how to do it in this recipe.

As an example, you will create an application that recolors all light parts of the image to black by analyzing the values of the following pixels. If the R (red), G (green), and B (blue) values are in the range [175, 255], the pixel is recolored to black.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To prepare an example that loads an image and recolors light parts of it, perform the following steps:

  1. Install the WriteableBitmapEx library using the NuGet Package Manager.
  2. Add the Image.jpg ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required