Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

from KnownColor to Color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fransis il Mulo - 18 Dec 2007 17:35 GMT
I've a color picker on my asp.net UI. When I select an Item from DB I
read R,G, and B values. Then I'd like to move the color picker to the
right color. The color picker has a property xColor of type
System.Drawing.Color.

It's all right If I write this code:

colorPicker.xColor = System.Drawing.Color.Black;

but it's wrong if I write:

colorPicker.xColor = System.Drawing.Color.FromArgb(0, 0, 0);

I'm looking for a way to transform RGB color to KnownColor but the final
type must be System.Drawing.Color .

Can you help me?

Thanks

Fransis
Fransis il Mulo - 18 Dec 2007 17:42 GMT
Fransis il Mulo ha scritto:
> I've a color picker on my asp.net UI. When I select an Item from DB I
> read R,G, and B values. Then I'd like to move the color picker to the
[quoted text clipped - 17 lines]
>
> Fransis

... I've already tried something like this without success:

System.Drawing.Color _color = System.Drawing.Color.FromArgb(0, 0, 0);
System.Drawing.KnownColor _knownColor = _color.ToKnownColor();
colorPicker.xColor = System.Drawing.Color.FromKnownColor(_knownColor);

... while this code works fine:

colorPicker.xColor = System.Drawing.Color.Black;
Andrew - 19 Dec 2007 04:56 GMT
Hi Fransis,

you should be able to do:

colorPicker.xColor = System.Drawing.Color.FromArgb(0,0,0).ToKnownColor();

What kind of color picker are you using?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.