圆角矩形,圆角矩形填充

//画圆角矩形,填充圆角矩形
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();
}

你可能感兴趣的:(圆角)