How to draw a circle with a line that will point to a value between 0 and 360 in C#?

  • Thread starter Thread starter Ranjini Rengan
  • Start date Start date
R

Ranjini Rengan

Guest
I have a code to draw a circle. I want to draw a line at an angle based on the value I get. The value range will be between 0 and 360.

Graphics g = this.pictureBox1.CreateGraphics();
System.Drawing.RectangleF PictBoxRect = new RectangleF();
PictBoxRect.Size = pictureBox1.Size;
PictBoxRect.Height = pictureBox1.Height - 5;
PictBoxRect.Width = pictureBox1.Width - 5;
PictBoxRect.X = 0;
PictBoxRect.Y = 0;
Pen pen = new Pen(Color.Black);
pen.Width = 10;
g.DrawEllipse(Pens.Black, PictBoxRect);

Continue reading...
 
Back
Top