请问在C#中画的圆
 Graphics g = this.CreateGraphics();
 Pen p = new Pen(Color.Black);
 g.DrawEllipse(p, 50, 50, 200, 200);    //中心点在哪,我觉得中心点是在(200-50)/2,其实不是
 g.DrawEllipse(p, 60, 60, 180, 180);       //为什么50到60,增量是10,而200到180,增量为20,这样画出的才是同心圆,而且我想在这个大圆的中心画个小 圆就不知道要怎么画了哦
 到底要怎么样才能找出这个圆的中心点呢?
  不有如何画实心圆呢?

解决方案 »

  1.   


            Pen n = new Pen(Color.Red, 5);    //定义一绿色画笔
            Graphics gc;                   //声明一 GDI+ 绘图面
            gc = Graphics.FromImage(bmp);  //从指定的 Image 创建新的 Graphics
            Point p = new Point(50, 50);              //定义一个点的水平位置
            Rectangle rg = new Rectangle(50, 50, 200, 200);
            gc.DrawEllipse(n, rg);            //画空心圆
            Brush bru  = new SolidBrush(Color.Red);
            gc.FillEllipse(bru, rg);         //填充空心圆,实心圆
      

  2.   

     Graphics   g   =   e.Graphics;;   
      Pen   Pen   =   new   Pen(Color.Red,1);   
      SolidBrush   mySolidBrush   =   new   SolidBrush(Color.FromArgb   (255,   0,   0));   
      g.DrawEllipse(Pen,80,80,240,240); //外圆   
      g.DrawEllipse(Pen,100,100,200,200);//内圆  
      

  3.   

    C# 
    public void DrawEllipse (
    Pen pen,
    int x,
    int y,
    int width,
    int height
    )
     
    C++ 
    public:
    void DrawEllipse (
    Pen^ pen, 
    int x, 
    int y, 
    int width, 
    int height
    )
     
    J# 
    public void DrawEllipse (
    Pen pen, 
    int x, 
    int y, 
    int width, 
    int height
    )
     
    JScript 
    public function DrawEllipse (
    pen : Pen, 
    x : int, 
    y : int, 
    width : int, 
    height : int
    )
     
    参数
    pen
    Pen,它确定曲线的颜色、宽度和样式。 x
    定义椭圆的边框的左上角的 X 坐标。 y
    定义椭圆的边框的左上角的 Y 坐标。 width
    定义椭圆的边框的宽度。 height
    定义椭圆的边框的高度。 注意最后2个参数不是坐标,是宽高
      

  4.   

    中心点是,width/2+x,height/2+y
    你的情况50,50,200,200,中心就是50+100,50+100即 150 150
    第二个60,60,180,180 ,中心60+90,60+90即150,150,所以他们同心
      

  5.   

            //
            // 摘要:
            //     绘制一个由边框(该边框由一对坐标、高度和宽度指定)定义的椭圆。
            //
            // 参数:
            //   y:
            //     定义椭圆的边框的左上角的 Y 坐标。
            //
            //   width:
            //     定义椭圆的边框的宽度。
            //
            //   height:
            //     定义椭圆的边框的高度。
            //
            //   pen:
            //     System.Drawing.Pen,它确定曲线的颜色、宽度和样式。
            //
            //   x:
            //     定义椭圆的边框的左上角的 X 坐标。
            public void DrawEllipse(Pen pen, int x, int y, int width, int height);
      

  6.   

    Graphics.DrawEllipse(Pen pen, int x, int y, int width, int height)
    一:中心点的坐标是(x+width/2,y+height/2)
    二:实心圆用Graphics.FillEllipse(参数)方法