//pDC由CView::OnDraw(CDC* pDC)得到;
//m_strTitle为要显示的文本内容;
CString strShow = m_strTitle;
if( m_bTimeReDraw )
{
nLeft ++;
//m_bTimeReDraw = FALSE;
}
//pDC->TextOut(m_rect.left - nLeft + m_rect.Width() /2 ,m_rect.top+ 2 ,strShow );
CDC oDCMemory; oDCMemory.CreateCompatibleDC( pDC );
CBitmap oBitmap; oBitmap.CreateCompatibleBitmap( pDC, m_rtClient.Width(),m_rtClient.Height());
oDCMemory.SelectObject( &oBitmap );
//CPen oPen;
//oPen.CreatePen(PS_SOLID,1,RGB(122,122,122));
//oDCMemory.SelectObject( &oPen );
//CBrush oBrush( RGB(0,122,122 ) );
//oDCMemory.SelectObject( &oBrush );
//oDCMemory.SetBkMode( TRANSPARENT );
//oDCMemory.SelectStockObject(SYSTEM_FIXED_FONT);
oDCMemory.FillSolidRect( oRectRow, clrBakLed );
oDCMemory.SetTextColor( RGB(255,0,0 ) );
CFont oFont;
oFont.CreateFont(14, 0,0,0, FW_NORMAL, 0,0,0, DEFAULT_CHARSET,
OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE, "宋体");
oDCMemory.SelectObject(&m_Font);
oDCMemory.TextOut( 0 + m_rect.Width(), 0, strShow );
//oDCMemory.TextOut( oSizeTxt.cx - nLeft, 0, strShow );
CSize oSizeTxt = oDCMemory.GetTextExtent( strShow );
CBrush oBrush( clrBakLed );
oDCMemory.SelectObject( &clrBakLed );
//oDCMemory.Rectangle( oSizeTxt.cx - nLeft + 1, 0, oSizeTxt.cx, oSizeTxt.cy );
if( nLeft > oSizeTxt.cx + m_rect.Width() - 1 )
nLeft = 0;
pDC->BitBlt( m_rect.left + 1, m_rect.top + 2, m_rect.Width() - 2, oSizeTxt.cy ,&oDCMemory, nLeft, 0, SRCCOPY );
if( m_bTimeReDraw )
{
m_bTimeReDraw = FALSE;
}
阅读(1779) | 评论(0) | 转发(0) |