设置圆角之后绘制边框,右边和底边少一个像素。为什么?
本帖最后由 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));
}