473,480 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Numeric values of Color.....

I am using Image button and its property backcolor = DarkGray.

How to find out the numeric value of this color?

Thanks,

Jack
Nov 18 '05 #1
3 1109
I assume by numeric value you mean the RGB values associated with that
color.

The values should then be in the Color.R, Color.G and Color.B byte values.
If you need to convert them to hex you can do something like this:

ImageButton.BackColor.R.ToString("X2");
ImageButton.BackColor.G.ToString("X2");
ImageButton.BackColor.B.ToString("X2");

If you are pulling the color by name you might have to do this:
System.Drawing.Color myColor = System.Drawing.Color.FromName("DarkGray");

Hope that helps,
Kyle

"Jack Smith" <Ja***********@hotmail.com> wrote in message
news:#l**************@TK2MSFTNGP10.phx.gbl...
I am using Image button and its property backcolor = DarkGray.

How to find out the numeric value of this color?

Thanks,

Jack

Nov 18 '05 #2
the w3c standard:

http://www.w3.org/TR/REC-html40/types.html#h-6.5

microsoft extensions:

http://msdn.microsoft.com/library/de..._namecodes.asp

-- bruce (sqlwork.com)
"Jack Smith" <Ja***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
| I am using Image button and its property backcolor = DarkGray.
|
| How to find out the numeric value of this color?
|
| Thanks,
|
| Jack
|
|
Nov 18 '05 #3
The best way is to use the ColorTranslator:

Color c = ColorTranslator.FromHtml("DarkGray");
Response.Write(c.R);
Response.Write(c.G);
Response.Write(c.B);

which is located in System.Drawing (you'll need to reference that dll).

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jack Smith" <Ja***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am using Image button and its property backcolor = DarkGray.

How to find out the numeric value of this color?

Thanks,

Jack

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1212
by: Kyler Laird | last post by:
Python 2.3.3 (#2, Jan 4 2004, 12:24:16) on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Numeric >>> import MLab >>> import Scientific.Statistics...
3
2177
by: Savas Ates | last post by:
i have 3 columns in sql server .. all of them are numeric value when a user enter my site i take the value of userid (numeric one) i assign it as session("userid ") after a query i take 2...
5
2430
by: M. Akkerman | last post by:
Hi, I've been working on this problem for a while now but I just can't seem to find a good solution for it. Here is the situation. I have the following class class TBigNumber {
3
6495
by: success_ny | last post by:
Does anyone have a code snippet to compare those values so I can sort the array of alpha-numeric values that include both characters and integers in it? I.e., if we have values like 4236 and...
4
3931
by: Gezeala 'Eyah' Bacu\361o II | last post by:
hey guys..need your help on this.. i have a plpgsql function where in i compute numeric values for my php scripts.. my problem is my function just won't round some numbers properly.. what i...
6
9191
by: M.A. Oude Kotte | last post by:
Hi All, I hope this is the correct mailing list for this question. But neither postgresql.org nor google could help me out on this subject. I did find one disturbing topic on the mailing list...
20
3651
by: MLH | last post by:
120 MyString = "How many copies of each letter do you need?" 150 MyVariant = InputBox(MyString, "How Many?", "3") If MyVariant = "2" Then MsgBox "MyVariant equals the string '2'" If...
11
2213
by: Pieter | last post by:
Hi, I'm having some troubles with my numeric-types in my VB.NET 2005 application, together with a SQL Server 2000. - I first used Single in my application, and Decimal in my database. But a...
7
1635
by: Sheldon | last post by:
Hi, I have the following loop that I think can be written to run faster in Numeric. I am currently using Numeric. range_va = main.xsize= 600 main.ysize= 600 #msgva is an (600x600) Numeric...
0
7044
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.