设立圆角之后绘制边框,右边和底边少一个像素。为什么

设置圆角之后绘制边框,右边和底边少一个像素。为什么?
本帖最后由 VisualEleven 于 2013-06-20 11:36:25 编辑
void OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
//设置圆角
CRect winRT;
GetClientRect(&winRT);
CRgn   rg;  
rg.CreateRoundRectRgn(winRT.left,   winRT.top,   winRT.right,   winRT.bottom,   5,   5); 
SetWindowRgn(rg,TRUE);
}

void OnPaint()
{
CPaintDC dc(this);
CDC  *pDC = &dc;

CBrush brushBlue(RGB(255, 255, 255));
pDC->SelectObject(&brushBlue);

CPen penBlack;
penBlack.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
pDC->SelectObject(&penBlack);

CRect rect;
GetClientRect(rect);
pDC->RoundRect(rect, CPoint(FUCKINGBANJING, FUCKINGBANJING));
}

忘了说,对话框属性是NoBorder

1、怎么改
2、有没有一篇文章详细讲圆角的?

------解决方案--------------------
注意 GDI 函数 通常是:
”该函数绘制的图形延伸到但不包括右边和底部坐标“
------解决方案--------------------
rect 要 放大一个点
------解决方案--------------------
GetClientRect(rect);
rect.DeflateRect(1, 1);
-----------------
把rect缩小一点试试