Implementing ToArgb()

Posted by Number8 on Stack Overflow See other posts from Stack Overflow or by Number8
Published on 2010-04-22T15:47:01Z Indexed on 2010/04/22 16:13 UTC
Read the original article Hit count: 398

Filed under:
|
|
|

Hello --
System.Drawing.Color has a ToArgb() method to return the Int representation of the color.
In Silverlight, I think we have to use System.Windows.Media.Color. It has A, R, G, B members, but no method to return a single value.
How can I implement ToArgb()? In System.Drawing.Color, ToArgb() consists of

return (int) this.Value;  

System.Windows.Media.Color has a FromArgb(byte A, byte R, byte G, byte B) method. How do I decompose the Int returned by ToArgb() to use with FromArgb()?

Thanks for any pointers...

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about c#