WPF image, pixel color change

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

+6
source share
1 answer

The GetPixel and SetPixel should work for what you need.

This answer provides an example of code that you can use for your use.

+3
source

Source: https://habr.com/ru/post/900080/


All Articles