int DrawEllipse()
{
   Graphics dc=this.GreateGrap0hics();
   Pen pen=new Pen(Color.Blue,5);//画笔
   dc.DrawEllipse(pen,0,50,80,60)//画圆
     return 1;
}

解决方案 »

  1.   

    我在写一个BUTTON的控件,想让它是一个圆角矩形的按钮,你给我的是椭圆啊,老大,因为将来是打包成DLL的,所以我不想再这个DLL里再调用API写了,直接画它,我自己画了一个你看一下,但我不知道怎么把它转化成一个类似与Rectangle myRectangle = new Rectangle();
    其实也可以理解成一个Region.protected  void DoPage(Graphics grfx, Color clr, int cx, int cy)
    {
    RoundedRectangle(grfx, Pens.Red,
    new Rectangle(0, 0, cx - 1, cy - 1),
    new Size(cx / 5, cy / 5));
    }
    void RoundedRectangle(Graphics grfx, Pen pen, Rectangle rect, Size size)
    {
    grfx.DrawLine(pen, rect.Left  + size.Width / 2, rect.Top,
    rect.Right - size.Width / 2, rect.Top);
    grfx.DrawArc(pen, rect.Right - size.Width, rect.Top,
    size.Width, size.Height, 270, 90);
    grfx.DrawLine(pen, rect.Right, rect.Top + size.Height / 2,
    rect.Right, rect.Bottom - size.Height / 2);
    grfx.DrawArc(pen, rect.Right  - size.Width,
    rect.Bottom - size.Height,
    size.Width, size.Height, 0, 90);
    grfx.DrawLine(pen, rect.Right - size.Width / 2, rect.Bottom,
    rect.Left  + size.Width / 2, rect.Bottom);
    grfx.DrawArc(pen, rect.Left, rect.Bottom - size.Height,
    size.Width, size.Height, 90, 90);
    grfx.DrawLine(pen, rect.Left, rect.Bottom - size.Height / 2,
    rect.Left, rect.Top + size.Height / 2);
    grfx.DrawArc(pen, rect.Left, rect.Top,
    size.Width, size.Height, 180, 90);
    }
      

  2.   

    你是要将Form 或其它的显示成圆角,还是要画图形。如果要画图,无非
    是Line 和Elilipse的结合,定义好点而已!MSDN上都有Graphics g =this.button1.CreateGraphics(); Pen myPen = new Pen(Color.Red);
    myPen.Width = 5;
    g.DrawLine(myPen, 1, 1, 45, 65);
    g.DrawBezier(myPen, 15, 15, 30, 30, 45, 30, 87, 20);
    g.DrawEllipse(myPen, new Rectangle(33, 45, 40, 50)); g.DrawPolygon(myPen, new PointF[] {new PointF(1, 1),   new PointF (20, 10), new PointF(5, 4), new PointF(100, 2), 
      new PointF(200, 50), new PointF(39, 45)});
      

  3.   

    发慢了,sorry,问题要描述清楚。
      

  4.   

    为什么不用APIGDI+不也是用API吗?