求助
我显示一张图片想用一个矩形把他遮盖住 但是矩形遮盖不住图片左侧和上侧都有一个边不能遮盖住 请高手指点..... 谢谢! 代码:
CRect m_rect = CRect(150,80,50,50);
CDC cdc;
cdc.CreateCompatibleDC(GetWindowDC());
cdc.SelectObject(&m_bitmap);
CDC *gdidc = GetWindowDC();
gdidc->BitBlt(m_rect.left,m_rect.top,m_rect.right,m_rect.bottom,&cdc,0,0,SRCCOPY);
HRGN hRgn = ::CreateRectRgn(m_rect.TopLeft().x,m_rect.TopLeft().y,m_rect.TopLeft().x+m_rect.BottomRight().x,m_rect.TopLeft().y+m_rect.BottomRight().y);
HBRUSH hBrush = ::CreateSolidBrush(RGB(255,0,0));
int i = (int)::FillRgn(gdidc->m_hDC,hRgn,hBrush);