1 Suppose there are 3 lines texts for scrolling from bottom to top.
2 some clips source code be  illustrated as follow:
  ScrollStatic::OnPaint()
  {
     ...
      CPaintDC PaintDC(this);
MemDC dc(&PaintDC);
        ...
        CRect rect;
GetClientRect(&rect);
for( int i = 0 ; i <3; i ++ )
        {
             ...
             dc.DrawText(..., rect, ... );
     rect.top += Height_Of_Font;
         }
   }
I have been stucking in the a pices of code for servel days,so I have no chioces but to do for helping. in the loop of the function, to my pointview, the drawing process should be like this:
  (top)
|
|
|
------------>|
|
------------>
   
poxY
|
------------>posX
  (bottom) 
suppose "|" be represented by Hight_Of_Font and the direction of scroll is from bottom to top.
3 firstly, dc object be initialized with address of PaintDC, so
  a memeory DC should be created in memory, the dimension of m_rect is alternative:left = 0, top = 0, height = xx, width = xx
my question is that
 what's relationship  between m_rect and rect?  
 how does BitBlt works?
 

解决方案 »

  1.   

    Whatever how many dc objects were created,  the worth of left and top of m_rect are always equal 0 , on other hand,  the value of Height() and  Width() are always constant , why? so I think the block-bit data be copied from memory to rect
      

  2.   

    是这么想的,BitBlt(...)的本质是先用DrawText(...)在memory中先画好将要显示的stuff,当需要显示时, 然后一次性从memory中拷贝的screen的memory中,这样的好处就是避免边DrawText(),便于流畅显示,不会闪烁,抖动,毕竟便画,便显示,很好时。