In Silverlight, what is the best way to convert between a System.Drawing.Color and a System.Windows.

Posted by Gene on Stack Overflow See other posts from Stack Overflow or by Gene
Published on 2008-12-31T20:40:38Z Indexed on 2010/04/17 5:43 UTC
Read the original article Hit count: 274

I'm trying to convert from a System.Drawing.Color to a Silverlight System.Windows.Media.Color. I'm actually trying to pass this color through a service.

The System.Drawing.Color, passed over the wire, does not serialize the argb value independently.

I can convert the argb value to a 32-bit int

[DataMember]  
public int MyColor { get { return Color.Red.ToArgb(); } set {} }

But I don't see any corresponding method in System.Windows.Media.Color to convert that back.

What is the best way to do this?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about drawing.color