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?
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?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货