Click here to Skip to main content
12,078,489 members (40,675 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#3.0 C# 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 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 7-Dec-12 5:51am
   
Error:A field initializer cannot reference the non-static field, method, or property 'aj._Default.hex'
CodeNinja-C# 7-Dec-12 6:10am
   
Sorry, I don't get you
Deenuji vellore 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160212.1 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2016
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