0

How can we change the Hue and Saturation of an Image inside a PictureBox?

Below is a screenshot of an app I wrote for Windows Phone. The first image shows a blue note icon, the second, shows an orange-red note icon.

Basically what I am trying to accomplish is change the hue/saturation of certain UI elements (toolbar icons (with images)) when hovered-over. Instead of loading all these images and having 2-3 different color variations for each image. I would prefer to just have 1 image and just programmatically change the hue and saturation accordingly when the image is hovered over:

Original image:

enter image description here

Altered image (desired effect when changing hue/saturnation programmatically):

enter image description here

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
jay_t55
  • 11,362
  • 28
  • 103
  • 174
  • Duplicate? http://stackoverflow.com/q/14364716/1324033 (you change the hue of the image not the picturebox) – Sayse Aug 16 '13 at 07:22
  • Thanks @Sayse, I just saw that but for some reason didn't think it was related. I'll reread it and see what I can do. :-) – jay_t55 Aug 16 '13 at 07:46
  • No worries, I saw a few different links to "change hue c#" – Sayse Aug 16 '13 at 07:54
  • Ah crud, it doesn't work. I used it, and changed the values accordingly. I change the Hue value in SetPixel to y == 137 and also if(y >= 130 && y <= 139) but it doesn't do anything. And I know for sure the color hue of the image is 137. – jay_t55 Aug 16 '13 at 08:02

0 Answers0