Click here to Skip to main content
11,490,282 members (33,254 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 ASP.NET Color convert , +
Actually i'm using color extender to pick the color in asp.net...but while i'm picking the color it generate the hex decimal values....but i need only rgb values...Pls any one guide me....
Posted 7-Dec-12 0:11am
Deenuji3.9K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try this I hope It will help you

How to convert Hexadecimal Color to RGB color (24 Bit)[^].

keep smiling Smile | :) Smile | :) Smile | :) haapy codingSmile | :)
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Have a look at this link:

http://snipplr.com/view/13358/[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Why have you posted this question when you have already been given the answer in the C# forum? Please post in one place only, and do not spam the forums.
  Permalink  
Comments
Deenuji vellore at 7-Dec-12 7:07am
   
k sir....hereafter i won't do like this...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

Solution:

Write this coding in button or whatever...

System.Drawing.Color MyColor = System.Drawing.Color.FromArgb(val);
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

string hex = "0x333366";
int r = Convert.ToInt32(hex.Substring(2,2),16);
int g = Convert.ToInt32(hex.Substring(4,2),16);
int p = Convert.ToInt32(hex.Substring(6,2),16);

--SJ
  Permalink  
Comments
Deenuji vellore at 7-Dec-12 5:51am
   
Error:A field initializer cannot reference the non-static field, method, or property 'aj._Default.hex'
CodeNinja-C# at 7-Dec-12 6:10am
   
Sorry, I don't get you
Deenuji vellore at 7-Dec-12 7:10am
   
if i using ur code means i got above error...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 520
1 Andy Lanng 233
2 OriginalGriff 188
3 Sascha Lefèvre 170
4 Maciej Los 160
0 Sergey Alexandrovich Kryukov 9,713
1 OriginalGriff 8,475
2 Sascha Lefèvre 3,504
3 Maciej Los 3,106
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100