本帖最后由 data2013 于 2012-09-13 20:29:26 编辑

解决方案 »

  1.   

    CDC::Rectangle  
    BOOL Rectangle( int x1, int y1, int x2, int y2 );BOOL Rectangle( LPCRECT lpRect );Return ValueNonzero if the function is successful; otherwise 0.Parametersx1Specifies the x-coordinate of the upper-left corner of the rectangle (in logical units).y1Specifies the y-coordinate of the upper-left corner of the rectangle (in logical units).x2Specifies the x-coordinate of the lower-right corner of the rectangle (in logical units).y2Specifies the y-coordinate of the lower-right corner of the rectangle (in logical units).lpRectSpecifies the rectangle in logical units. You can pass either a CRect object or a pointer to a RECT structure for this parameter.
    -------------------------------------------------------
    CDC::LineTo  
    BOOL LineTo( int x, int y );BOOL LineTo( POINT point );Return ValueNonzero if the line is drawn; otherwise 0.ParametersxSpecifies the logical x-coordinate of the endpoint for the line.ySpecifies the logical y-coordinate of the endpoint for the line.pointSpecifies the endpoint for the line. You can pass either a POINT structure or a CPoint object for this parameter.
    ================================================
    CDC::Ellipse
    This method draws an ellipse.BOOL Ellipse( 
    int x1, 
    int y1, 
    int x2, 
    int y2 );BOOL Ellipse( 
    LPCRECT lpRect ); 
    Parameters
    x1 
    The logical x-coordinate of the upper-left corner of the bounding rectangle of the ellipse. 
    y1 
    The logical y-coordinate of the upper-left corner of the bounding rectangle of the ellipse. 
    x2 
    The logical x-coordinate of the lower-right corner of the bounding rectangle of the ellipse. 
    y2 
    The logical y-coordinate of the lower-right corner of the bounding rectangle of the ellipse. 
    lpRect 
    The bounding rectangle of the ellipse. You can also pass a CRect object for this parameter. 
    ===========================
    x2-x1 == y2-y1的时候就是圆形