Below is a demo of changing color of an icon. Only alpha channel of the image is preserved. Remaining channels (R,G, and B specifically) are set to the fill color. Notice that even the alpha channel can be toned down if necessary.
You can use the control from XAML like this:
<jc:ColoredImage Foreground="Yellow" Source="TestImage.png" />
ColoredImage supports the following properties:
- Source - ImageSource of the image to be colored.
- Foreground - New color of the image. All visible pixels of the image will get this color.
- Stretch - Same meaning as in Image.Stretch. Default is Uniform.
- Standard Control properties: Width/Height, Margin, Padding, Background, BorderBrush, etc.
You can download this control as part of my opensource JungleControls library. Enjoy.