J Jack Smith Nov 5, 2004 #1 I am using Image button and its property backcolor = DarkGray. How to find out the numeric value of this color? Thanks, Jack
I am using Image button and its property backcolor = DarkGray. How to find out the numeric value of this color? Thanks, Jack
K Kyle Eberle Nov 6, 2004 #2 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
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
B bruce barker Nov 6, 2004 #3 the w3c standard: http://www.w3.org/TR/REC-html40/types.html#h-6.5 microsoft extensions: http://msdn.microsoft.com/library/d...ncnt/html/sdkquickref_htmlcolor_namecodes.asp -- bruce (sqlwork.com) | I am using Image button and its property backcolor = DarkGray. | | How to find out the numeric value of this color? | | Thanks, | | Jack | |
the w3c standard: http://www.w3.org/TR/REC-html40/types.html#h-6.5 microsoft extensions: http://msdn.microsoft.com/library/d...ncnt/html/sdkquickref_htmlcolor_namecodes.asp -- bruce (sqlwork.com) | I am using Image button and its property backcolor = DarkGray. | | How to find out the numeric value of this color? | | Thanks, | | Jack | |
K Karl Seguin Nov 6, 2004 #4 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
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