在桌面中间绘制圆圈

时间:2013-06-29 13:39:57

标签: c# drawing geometry

heyho伙计,

你可以帮我在桌面中间绘制一个圆圈吗? 我对桌面坐标非常沮丧。 这是一个叠加

这是我的代码:

Graphics g = default(Graphics);
g = pictureBox1.CreateGraphics();
//g.DrawEllipse(Pens.Red, 10, 10, 200, 200);
int screenmiddlx = this.Width / 2;
int screenmiddly = this.Height / 2;
int kscreenmoddly = Height;
int kscreenmoddlx = Width;

g.DrawLine(Pens.Red, screenmiddlx - 10, screenmiddly, screenmiddlx + 10, screenmiddly);
g.DrawLine(Pens.Red, screenmiddlx, screenmiddly - 10, screenmiddlx, screenmiddly + 10);
g.DrawEllipse(Pens.Red,,,,);

1 个答案:

答案 0 :(得分:0)

这是我的代码:

        Graphics kp = e.Graphics;
        kp.DrawEllipse(Pen, x, y, width, height);
        // exemple for you:
        kp.DrawEllipse(Pens.Red, screenmiddlx, screenmiddly, 20, 20);