
 Rank: Guest Groups: Guest
Joined: 9/17/2007 Posts: 11,670 Points: -1,200
|
Date parsed: 29/03/2008 14:42:29 Date: Sat, 29 Mar 2008 13:42:29 +0100
Nicolas Pavlidis schreef: > Jos Roijakkers wrote: >> I am having trouble in retrieving color values. I am using VB.Net 2005 >> and this is what I want to achieve: >> >> I want to retrieve the color value of a control that is located on a >> Windows form (NOT a Web applicaion). >> E.g. if the color is yellow I need the value &HFF to be returned to a >> variable. > > Maybe this way: > > Color col = Color.Yellow; > col.ToArgb(); > > Color.ToArgb returns an int containing all four bytes of a ARGB colorvalue. > > If you really need the single values a bit of bitshfiting whould be > necessary to extract the three least significant bytes out from the int. > The most significant byte shoud be the alpha - blend (the A in ARGB :-) ). > > If you only wanna disply the ARGB - Vlue a simple formater should exist > somewhere in .NET :-) > > HTH && Kind regards, > Nicolas
Thanks Nicolas, that put me into the right direction.
Jos
|

 Rank: Guest Groups: Guest
Joined: 9/17/2007 Posts: 11,670 Points: -1,200
|
Date parsed: 31/03/2008 12:23:16 Date: Mon, 31 Mar 2008 19:23:16 -0700
What do you mean, the "color value of a control" ? Which color are you talking about? Background color, Foreground color? What kind of control.
RobinS. GoldMail.com
"Jos Roijakkers" <jos@jr-video.nl> wrote in message news:eXqMXdDkIHA.1208@TK2MSFTNGP05.phx.gbl... >I am having trouble in retrieving color values. I am using VB.Net 2005 and >this is what I want to achieve: > > I want to retrieve the color value of a control that is located on a > Windows form (NOT a Web applicaion). > E.g. if the color is yellow I need the value &HFF to be returned to a > variable. > > Any help is appreciated. > > Jos
|