Hey.
I recently ran into a problem trying to do some custom drawing in a view. (CScrollView derived). I use FillSolidRect to fill a rectangle, and then DrawText to render some text in OnDraw. The problem is that all of the text is set on the background that i set using FillSolidRect as opposed only to the bit that i defined as.
Here is some code:
Any ideas why?Code:pDC->FillSolidRect( m_lbtnDown.x, m_lbtnDown.y, m_lbtnUp.x - m_lbtnDown.x, m_lbtnUp.y - m_lbtnDown.y, m_crTestA); ... CPoint ScrolledPos = GetScrollPosition(); CRect rectClient; GetClientRect(&rectClient); pOldFont = pDC->SelectObject(m_pFont); nHeight = MeasureFontHeight(m_pFont, pDC); ... pDC->DrawText(strRender, -1, &ScrollRect, DT_TOP|DT_NOPREFIX|DT_SINGLELINE); ... pDC->SelectObject(pOldFont);
Thx in advance.




Reply With Quote