Something like this perhaps?
Random r=new Random(DateTime.Now.Millisecond);
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs
e)
{
e.Graphics.FillEllipse(Brushes.BlanchedAlmond,0,0,this.ClientSize.Width,this
..ClientSize.Height);
for(double a=0; a<360; a+=30)
{
SolidBrush b=new SolidBrush(Color.FromArgb(r.Next(255),
r.Next(255),r.Next(255)));
e.Graphics.FillPie(b,10,10,this.ClientSize.Width-20,this.ClientSize.Height-2
0,(float)a,25);
}
}
--
Bob Powell [MVP]
C#, System.Drawing
The October edition of Well Formed is now available.
Find out how to use DirectX in a Windows Forms control
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
Blog
http://bobpowelldotnet.blogspot.com
Eric said:
I need to draw a wheel. It should look about like the Wheel of Fortune
wheel. I also need to be able to change the colors in each section. I know
how to draw circles and lines but I have no idea how to fill each section
with different colors. Can someone post a little sample code. Perhaps a
circle in 2 pieces that you can change the color?