We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

# NEED HELP FAST

on
Medium Priority
233 Views
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
Comment
Watch Question

## View Solution Only

Retired
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
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

Not the solution you were looking for? Getting a personalized solution is easy.

##### Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile