//创建透明画刷
CClientDC dc(this);
//使用(HBRUSH)GetStockObject可以返回空画刷句柄,但CBrush
//无法通过画刷句柄构造,可通过给其静态成员函数FromHandle传递HBRUSH
//句柄获得CBrush指针
CBrush *pBrush=CBrush::FromHandle((HBRUSH)GetStockObject(NULL_BRUSH));
CBrush *pOldBrush=dc.SelectObject(pBrush);
dc.Rectangle(CRect(m_ptOrigin,point));
dc.SelectObject(pOldBrush);
时间: 2024-12-12 16:51:41