GraphicsPath * pPath = MakeRoundRect(Point(0, 0), Point(300, 300), m_Slider.GetPos());
  GraphicsPath* MakeRoundRect(Point topLeft, Point bottomRight, INT percentageRounded)
{
ASSERT (percentageRounded >= 1 && percentageRounded <= 100); INT left  = min(topLeft.X, bottomRight.X);
INT right = max(topLeft.X, bottomRight.X); INT top    = min(topLeft.Y, bottomRight.Y);
INT bottom = max(topLeft.Y, bottomRight.Y); INT offsetX = (right-left)*percentageRounded/100;  
INT offsetY = (bottom-top)*percentageRounded/100; GraphicsPath pt;
GraphicsPath * path = pt.Clone(); path->AddArc(right-offsetX, top, offsetX, offsetY, 270, 90);

path->AddArc(right-offsetX, bottom-offsetY, offsetX, offsetY, 0, 90); path->AddArc(left, bottom - offsetY, offsetX, offsetY, 90, 90); path->AddArc(left, top, offsetX, offsetY, 180, 90); path->AddLine(left + offsetX, top, right - offsetX/2, top); return path;
}

解决方案 »

  1.   

     C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc
     中怎么搜索RoundRect函数
      

  2.   


        path->AddArc(right-offsetX, top, offsetX, offsetY, 270, 90);
         
        path->AddArc(right-offsetX, bottom-offsetY, offsetX, offsetY, 0, 90);
     
        path->AddArc(left, bottom - offsetY, offsetX, offsetY, 90, 90);
     
        path->AddArc(left, top, offsetX, offsetY, 180, 90);
     
        path->AddLine(left + offsetX, top, right - offsetX/2, top);
    //什么意思???????????????
      

  3.   

    每次都加一个arc 然后把arc相连接
      

  4.   


    这个我上次和你说要使用SourceInsight这个编辑器
      

  5.   

    AddArc是画弧函数,前面4个参数是形成一个Rect,这个Rect外接弧线。后面2个参数是开始角度和结尾角度。