Click here to Skip to main content
15,908,843 members
Home / Discussions / C#
   

C#

 
AnswerRe: Reading "Image/Picture taken" information from imagefiles on disk Pin
Rei Miyasaka28-May-06 13:24
Rei Miyasaka28-May-06 13:24 
GeneralRe: Reading "Image/Picture taken" information from imagefiles on disk Pin
Larantz28-May-06 22:08
Larantz28-May-06 22:08 
GeneralRe: Reading "Image/Picture taken" information from imagefiles on disk Pin
Rei Miyasaka28-May-06 22:22
Rei Miyasaka28-May-06 22:22 
Questionreading from exe.config file using ConfigurationManager [modified] Pin
shaul zak28-May-06 8:55
shaul zak28-May-06 8:55 
AnswerRe: reading from exe.config file using ConfigurationManager [modified] Pin
shaul zak28-May-06 23:57
shaul zak28-May-06 23:57 
Questionrun other programs as mdi at own prog Pin
FreewareFire28-May-06 8:09
FreewareFire28-May-06 8:09 
AnswerRe: run other programs as mdi at own prog Pin
FreewareFire28-May-06 12:02
FreewareFire28-May-06 12:02 
QuestionColor Wheel [modified] Pin
Cerasti28-May-06 7:23
Cerasti28-May-06 7:23 
Hello!

I'm trying to create a color wheel like this one, but I can't get it just right. I've managed to get a star, a cube and pretty much every shape except the one found in that link. I'm using GDI+.

I have some code here:
        protected override void OnPaint(PaintEventArgs e)<br />
        {<br />
            Graphics g = e.Graphics;<br />
            SolidBrush b = new SolidBrush(Color.Transparent);<br />
            <br />
            Point[] points = new Point[4];<br />
            Colors.HSL hsl = new Colors.HSL();<br />
            hsl.S = 1;<br />
            hsl.L = 1;<br />
            <br />
            for (int i = 0; i < 23; i++)<br />
            {<br />
                points[0].X = Convert.ToInt32(Math.Floor(Math.Sin(i - 7.5) * 24)) + (this.Width / 2);<br />
                points[0].Y = Convert.ToInt32(Math.Floor(Math.Cos(i - 7.5) * 24)) + (this.Height / 2);<br />
<br />
                points[1].X = Convert.ToInt32(Math.Floor(Math.Sin(i + 7.5) * 24)) + (this.Width / 2);<br />
                points[1].Y = Convert.ToInt32(Math.Floor(Math.Cos(i + 7.5) * 24)) + (this.Height / 2);<br />
<br />
                points[2].X = Convert.ToInt32(Math.Floor(Math.Sin(i - 7.5) * 100)) + (this.Width / 2);<br />
                points[2].Y = Convert.ToInt32(Math.Floor(Math.Cos(i - 7.5) * 100)) + (this.Height / 2);<br />
<br />
                points[3].X = Convert.ToInt32(Math.Floor(Math.Sin(i + 7.5) * 100)) + (this.Width / 2);<br />
                points[3].Y = Convert.ToInt32(Math.Floor(Math.Cos(i + 7.5) * 100)) + (this.Height / 2);<br />
<br />
                hsl.H += 0.043;<br />
                b.Color = Colors.HSL_to_RGB(hsl);<br />
<br />
                g.FillPolygon(b,points,System.Drawing.Drawing2D.FillMode.Alternate);<br />
            }<br />
        }


The problem is the part with point[x]... part, I don't know how to get it right. It would be great if someone could show me how to create a ball with 24 diffrent hues, theory or code it doesn't matter.

Regards,
Martin

-- modified at 14:22 Sunday 28th May, 2006
AnswerRe: Color Wheel [modified] Pin
Robert Rohde28-May-06 11:20
Robert Rohde28-May-06 11:20 
GeneralRe: Color Wheel [modified] Pin
Cerasti29-May-06 4:37
Cerasti29-May-06 4:37 
GeneralRe: Color Wheel [modified] Pin
Cerasti6-Jun-06 6:18
Cerasti6-Jun-06 6:18 
QuestionPassing value from form to an active form Pin
JelleM28-May-06 6:27
JelleM28-May-06 6:27 
AnswerRe: Passing value from form to an active form [modified] Pin
StevenS_Dev28-May-06 7:26
StevenS_Dev28-May-06 7:26 
GeneralRe: Passing value from form to an active form Pin
JelleM28-May-06 7:34
JelleM28-May-06 7:34 
AnswerRe: Passing value from form to an active form [modified] Pin
Alex B. Clarke28-May-06 7:59
Alex B. Clarke28-May-06 7:59 
GeneralRe: Passing value from form to an active form [modified] Pin
JelleM28-May-06 9:31
JelleM28-May-06 9:31 
GeneralRe: Passing value from form to an active form [modified] Pin
Alex B. Clarke28-May-06 10:06
Alex B. Clarke28-May-06 10:06 
GeneralRe: Passing value from form to an active form [modified] Pin
StevenS_Dev28-May-06 14:46
StevenS_Dev28-May-06 14:46 
Questiondelete Pin
kjosh28-May-06 5:55
kjosh28-May-06 5:55 
AnswerRe: delete Pin
WillemM28-May-06 6:54
WillemM28-May-06 6:54 
AnswerRe: delete Pin
JelleM28-May-06 6:54
JelleM28-May-06 6:54 
QuestionWhy new node in TreeList not can have focus? Pin
Dima Filipiuk28-May-06 5:46
Dima Filipiuk28-May-06 5:46 
AnswerRe: Why new node in TreeList not can have focus? Pin
stancrm28-May-06 21:13
stancrm28-May-06 21:13 
GeneralRe: Why new node in TreeList not can have focus? [modified] Pin
Dima Filipiuk29-May-06 0:45
Dima Filipiuk29-May-06 0:45 
QuestionTrigger event when a process exits Pin
Mridang Agarwalla28-May-06 2:47
Mridang Agarwalla28-May-06 2:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.