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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 63

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL ( and MongoDB (…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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