Welcome Guest Search | Active Topics | Members | Log In | Register

Re: Convert color name to RGB value Options · View
Jos Roijakkers
Posted: Saturday, March 29, 2008 2:42:29 PM


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
RobinS
Posted: Monday, March 31, 2008 12:23:16 PM


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

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.493 seconds.