MFC中的InvalidateRect问题
我用InvalidateRect(pDoc->rect,TRUE)将pDoc->rect区域擦除,但是结果却与InvalidateRect(pDoc->rect,FALS...
我用InvalidateRect(pDoc->rect,TRUE)将pDoc->rect区域擦除,但是结果却与InvalidateRect(pDoc->rect,FALSE)一样,不会擦除rect区域;
但是InvalidateRect(NULL,TRUE)与InvalidateRect(NULL,FALSE)的结果却是不同的,一个有擦除,另一个没有,和我自己想的结果相同。
请问各位高手,这是什么原因?
&(pDoc->rect)和pDoc->rect效果一样,我试过
第二个我知道,第一个InvalidateRect(&(pDoc->rect),TRUE)是怎么回事,我无法理解,请高手指点 展开
但是InvalidateRect(NULL,TRUE)与InvalidateRect(NULL,FALSE)的结果却是不同的,一个有擦除,另一个没有,和我自己想的结果相同。
请问各位高手,这是什么原因?
&(pDoc->rect)和pDoc->rect效果一样,我试过
第二个我知道,第一个InvalidateRect(&(pDoc->rect),TRUE)是怎么回事,我无法理解,请高手指点 展开
展开全部
第二个参数是指示使矩形区域无效时,是否擦除矩形区域的背景的,TRUE的话就擦除背景,FALSE就不擦除,InvalidateRect(NULL,TRUE)表示擦除整个窗口的背景,InvalidateRect(NULL,FALSE)则不是。
MSDN上是这么说的:
CWnd::InvalidateRect
void InvalidateRect( LPCRECT lpRect, BOOL bErase = TRUE );
The bErase parameter specifies whether the background within the update area is to be erased when the update region is processed. If bErase is TRUE, the background is erased when the BeginPaint member function is called; if bErase is FALSE, the background remains unchanged. If bErase is TRUE for any part of the update region, the background in the entire region is erased, not just in the given part.
Windows sends a WM_PAINT message whenever the CWnd update region is not empty and there are no other messages in the application queue for that window.
MSDN上是这么说的:
CWnd::InvalidateRect
void InvalidateRect( LPCRECT lpRect, BOOL bErase = TRUE );
The bErase parameter specifies whether the background within the update area is to be erased when the update region is processed. If bErase is TRUE, the background is erased when the BeginPaint member function is called; if bErase is FALSE, the background remains unchanged. If bErase is TRUE for any part of the update region, the background in the entire region is erased, not just in the given part.
Windows sends a WM_PAINT message whenever the CWnd update region is not empty and there are no other messages in the application queue for that window.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询