Bite my bytes

What I learn by day I blog at night - A blog from Microsoft Consultant working from Ljubljana, Slovenia

  Home :: Contact :: Syndication  
  999 Posts :: 7691 Comments :: 235 Trackbacks


Most popular posts
in last 90 days


My Projects



Copyright © by David Vidmar
Contact me!
LinkedIn Profile

I came across this little gem in .NET.

I was trying to easily encode some colors and it seemed impossible to do it directly with Color and Brush. But just when I wanted to write my own function to convert RRGGBB encoded color to a SolidBrush via Color.FromArgb() I found ColorTranslator. I just added a '#' character in front of RRGGBB and converted it with ColorTranslator.FromHtml().

this.ForeBrush = new SolidBrush(ColorTranslator.FromHtml("#" + sColor));

Ain't that sweet? This kind of moments make me wanna hug VS.NET.

Posted on Monday, December 13, 2004 5:45 PM | Filed under: Developement |
Comments have been closed on this topic.