Convert System.Drawing.Color to System.Windows.Media.Color [duplicate]

How about:

using MColor = System.Windows.Media.Color;
using DColor = System.Drawing.Color;
...

public static MColor ToMediaColor(this DColor color)
{
   return MColor.FromArgb(color.A, color.R, color.G, color.B);
}

EDIT: Fixed the ‘unpacking’ of the ARGB.

Leave a Comment

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