如何擦除在picture控件上已画的直线最好能给段代码
急急急
添加 WM_ERASEBKGND 消息:
比如:
BOOL CMyPicture::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetClientRect(&rect);
CBrush backBrush(RGB(245,245,245)); // 这里的颜色设置为背景色
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}