Converting System.Windows.Media.Color to System.Dr

2020-02-11 18:15发布

问题:

private void DialogFont_Load(object sender, EventArgs e)
{
    LoadInstalledFonts();
    SetupInitialDialogSelections();
    lblPreview.ForeColor = colorPicker1.colorPickerControlView1.CurrentColor.Color;
}

I'd like to convert the value to a System.Drawing.Color.

Any ideas?

回答1:

System.Windows.Media.Color mediacolor; // your color

var drawingcolor = System.Drawing.Color.FromArgb(
    mediacolor.A, mediacolor.R, mediacolor.G, mediacolor.B);