6

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?

Stewbob
  • 16,759
  • 9
  • 63
  • 107
Ivan
  • 609
  • 8
  • 21

1 Answers1

3

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.

Community
  • 1
  • 1
Stewbob
  • 16,759
  • 9
  • 63
  • 107
  • Thank you, It works. I'm using WPF, but I've understood, what to do - just create BitmapSource from Bitmap, using Interop – Ivan Oct 27 '11 at 20:51