Solved

NEED HELP FAST

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

            this.TransparencyKey = Color.WhiteSmoke;
            this.BackColor = Color.WhiteSmoke;
            this.Refresh();
            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
0
Comment
Question by:schenkp
[X]
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

by:
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);

Fernando
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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