Article ID: 117387
Article Last Modified on 11/21/2006
void CScrollView::FillOutsideRect(CDC* pDC, CBrush* pBrush)
{
ASSERT_VALID(pDC);
ASSERT_VALID(pBrush);
// Fill Rect outside the image
CRect rect;
GetClientRect(rect);
ASSERT(rect.left == 0 && rect.top == 0);
rect.left = m_totalDev.cy;
if (!rect.IsRectEmpty())
pDC->FillRect(rect, pBrush); // vertical strip along the side
rect.left = 0;
rect.right = m_totalDev.cy;
rect.top = m_totalDev.cy;
if (!rect.IsRectEmpty())
pDC->FillRect(rect, pBrush); // horizontal strip along the
// bottom
}
This implementation is incorrect because it sets rect.left and rect.right
to "m_totalDev.cy", instead of setting them equal to "m_totalDev.cx".
rect.left = m_totalDev.cx; rect.right = m_totalDev.cx;Rebuild the MFC libraries with this change. The README.TXT file in the Visual C++ MFC\SRC directory describes how to do this.
BOOL CDibView::OnEraseBkgnd(CDC* pDC)
{
CBrush br( GetSysColor( COLOR_ACTIVECAPTION ) );
FillOutsideRect( pDC, &br );
return TRUE; // Erased
}
After rebuilding DIBLOOK, use it to load a bitmap whose height is greater
than its width (WINNT.BMP is one example). There will be an unfilled area
at the right of the bitmap.
(BitmapWidth) < x < (BitmapWidth) + (BitmapHeight - BitmapWidth) (0) < y < (BitmapHeight)is never painted.
Additional query words: 1.00 1.50 2.00 2.10 2.50
Keywords: kbbug kbdocview kbfix kbprb kbvc200fix KB117387