圆角矩形,圆角矩形填充

//画圆角矩形,填充圆角矩形
BOOL CCurveCurrentDlg::OnEraseBkgnd(CDC *pDC)
{
       CRect  rect;
        this->GetClientRect(&rect);
        CRgn     roundRect;                       //圆角矩形区
        CBrush   selBsh;
        selBsh.CreateSolidBrush(RGB(144, 150, 152));
        POINT ptRound;
        ptRound.x = 7;
        ptRound.y = 7;
        pDC->RoundRect(rect, ptRound);             //用当前画笔画圆角边框
        roundRect.CreateRoundRectRgn(rect.left + 1, rect.top, rect.right, rect.bottom, ptRound.x, ptRound.y);  //填充圆角矩形范围
        pDC->FillRgn(&roundRect, &selBsh);
        selBsh.DeleteObject();
}

posted @ 2011-11-11 17:32  奥雷连诺  阅读(377)  评论(0编辑  收藏  举报