How to convert from System.Drawing.Color to System.Windows.Media.Color?

You can see examples of both of the conversion directions below:

Drawing.Color to Windows.Media.Color

// This is your color to convert from
System.Drawing.Color color; 
System.Windows.Media.Color newColor = System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B);

Windows.Media.Color to Drawing.Color

// This is your color to convert from
System.Windows.Media.Color color; 
System.Drawing.Color newColor = System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)