How do you change the color of an Image in WPF?

前端 未结 2 1097
我寻月下人不归
我寻月下人不归 2020-12-12 00:13

I have a .png image that\'s just white-on-transparent, and I\'m wondering if there\'s an easy way to make that green-on-transparent, red-on-transparent, etc so I don\'t need

2条回答
  •  無奈伤痛
    2020-12-12 00:57

    For a simpler solution that doesn't require pulling in huge libraries and lets you understand what's going on under their hood (and thus gives you greater flexibility), learn how to use WPF Pixel Shaders (google it).

    Then you can use something like the multiply shader here: http://rakeshravuri.blogspot.com/2008/08/blending-modes-in-wpf-using.html

提交回复
热议问题