如题:现在我想绘制椭圆,但只有长短轴长度和一个中心点,能绘图吗?

解决方案 »

  1.   

    BOOL Ellipse(
      HDC hdc, 
      int nLeftRect, 
      int nTopRect, 
      int nRightRect, 
      int nBottomRect
    ); 
    Parameters
    hdc 
    [in] Handle to the device context. 
    nLeftRect 
    [in] Specifies the x-coordinate of the upper left corner of the bounding rectangle. 
    nTopRect 
    [in] Specifies the y-coordinate of the upper left corner of the bounding rectangle. 
    nRightRect 
    [in] Specifies the x-coordinate of the lower right corner of the bounding rectangle. 
    nBottomRect 
    [in] Specifies the y-coordinate of the lower right corner of the bounding rectangle. 
    楼主有长轴a,短轴b,中心(x,y);
    nleft = x - (a/2);
    nTop = y - (b/2);
    nRight = nleft + a;
    nBottom = nTop + b;
      

  2.   

    能绘。
    BOOL Ellipse(
       int x1,
       int y1,
       int x2,
       int y2 
    );
    BOOL Ellipse(
       LPCRECT lpRect 
    );
    参数够用了。
      

  3.   

    有一个问题
    Ellipse应该是带填充的
    不是一个椭圆框
      

  4.   


    SelectObject一个NULL Brush再画
      

  5.   


    设置一个透明画刷CBrush *pBrush=CButton::FromHandle((HBRUSH)GetStockObject(NULL_BRUSH));选入设备描述表,就可以了