Ivan
Ivan

Reputation: 649

WPF Image, changing color of pixels

I have a problem. I need to fill (or repaint) some pixels at image, stored in Image control. This is a png image. I mean, that all black pixels should be filled with, for example, red color. How can I do this? I thought I can access directly to pixels and using XOR change special bits, but I don't know how to do this. Or maybe there is an easier way?

Upvotes: 6

Views: 4725

Answers (1)

Stewbob
Stewbob

Reputation: 16899

The GetPixel and SetPixel methods should work for what you need.

This answer has a code sample that you should be able to adopt for your use.

Upvotes: 3

Related Questions