Posted on 2006-11-06
Last Modified: 2011-09-20
Hi I am useing the following code to draw a circle

            this.TransparencyKey = Color.WhiteSmoke;
            this.BackColor = Color.WhiteSmoke;
            Graphics g = this.CreateGraphics();
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;        
            g.DrawArc(new Pen(Brushes.Blue, 6f), 5, 5, 700, 700, 0, 90);
            g.DrawArc(new Pen(Brushes.Red, 6f), 5, 5, 700, 700, 90, 90);
            g.DrawArc(new Pen(Brushes.Yellow, 6f), 5, 5, 700, 700, 180, 90);
           g.DrawArc(new Pen(Brushes.Green, 6f), 5, 5, 700, 700, 270, 90);

but i am tring to have the following colors in 90' segments starting with 0' if 0' was due north... all the way around the circle....

green 315 - 45
blue 45 - 135
red 135 - 225
yellow 225-315
Question by:schenkp
1 Comment
LVL 62

Accepted Solution

Fernando Soto earned 500 total points
ID: 17886798
Hi schenkp;

I think that these are the values you are looking for.

      g.DrawArc(new Pen(Brushes.Blue, 6f), 5, 5, 700, 700, 315, 90);
      g.DrawArc(new Pen(Brushes.Red, 6f), 5, 5, 700, 700, 45, 90);
      g.DrawArc(new Pen(Brushes.Yellow, 6f), 5, 5, 700, 700, 135, 90);
      g.DrawArc(new Pen(Brushes.Green, 6f), 5, 5, 700, 700, 225, 90);


Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In a recent question ( here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question