1

So i probably have a very simple problem but until now i haven't found a solution for it nor have i found a post about it.

In WPF i am using the "Colors" class, now with the color have selected in my WPF interface i want to make some color changes in a bitmap. Now from what i know you are not just able to use the Colors you use in WPF to modify a bitmap, you need to convert it in some way the the "Color" class but i can't seems to find a way to do it.

I've read something about Colors to Brush but i don't think that is the solution i am looking for.

DLP
  • 209
  • 4
  • 11

1 Answers1

2

So i managed to find the solution by myself. I should of realised i could just switch form the Media to Drawing class.

I did the conversion like this:

    System.Windows.Media.Color wpfColor; 

    var winformsColor= System.Drawing.Color.FromArgb(wpfColor.A, wpfColor.R, wpfColor.G, wpfColor.B);
DLP
  • 209
  • 4
  • 11
  • by switching from System.Windows.Media to System.Drawing you are actually going back to Winforms instead of WPF. Not a good or clean solution! – juFo Mar 27 '19 at 09:59