|
meet trouble with ps.fErase and Petzold
i'm a beginer with win32 gdi, i read "programming windows" now, thus i meet this question:
quote from petzold's book :
"However, if your program invalidates a rectangle of the client area by calling InvalidateRect, the last argument of the function specifies whether you want the background erased. If this argument is FALSE (that is, 0), Windows will not erase the background and the fErase field of the PAINTSTRUCT structure will be TRUE (nonzero) after you call BeginPaint."
my code :
the result after i click mouse is there's a 'a' in the window, but no 'b', i think it's make sense that the 'a' is still on the screen since i give FALSE when i call InvalidateRect, but why there's no 'b'? it just means ps.fErase is FALSE, and it means the P - e - t - z - o - l - d is wrong ..... am i miss anything?
Edited by - ed9er on March 9, 2001 2:00:51 AM
------------------------------------------------------CCP is fascistic, they even banned www.sourceforge.net
Are you listening to yourself?
You say that sending in FALSE sets ps.fErase to FALSE, right? And I assume you want ''b'' to draw when you send in false, right? But in your code:
You draw ''b'' only when TRUE is sent--so it won''t draw when FALSE is sent. Correct me is I''m interpreting your question wrong.
Jinushaun
quote:
the result after i click mouse is there''s a ''a'' in the window, but no ''b'', i think it''s make sense that the ''a'' is still on the screen since i give FALSE when i call InvalidateRect, but why there''s no ''b''? it just means ps.fErase is FALSE, and it means the P - e - t - z - o - l - d is wrong ..... am i miss anything?
You say that sending in FALSE sets ps.fErase to FALSE, right? And I assume you want ''b'' to draw when you send in false, right? But in your code:
|
You draw ''b'' only when TRUE is sent--so it won''t draw when FALSE is sent. Correct me is I''m interpreting your question wrong.
Jinushaun
JinushaunNation Leprechaun
i'm sure that you have not read the quote at the beginning
or maybe my english sux ...
Edited by - ed9er on March 9, 2001 3:12:18 AM
or maybe my english sux ...
Edited by - ed9er on March 9, 2001 3:12:18 AM
------------------------------------------------------CCP is fascistic, they even banned www.sourceforge.net
Look up PAINTSTRUCT in the MSDN docs. You''ll see that fErase will be a non-zero value (i.e. TRUE) when the background needs to be erased. It will be FALSE otherwise. It''s probably a printing error in the book. Go email Charles and tell him about it
![](smile.gif)
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Actually, the msdn says that the fErase is TRUE when the application is responsible to clear the background. It also says that this is when the window has been created with no background brush. So it''s not just a printing error, it''s a conceptual error on Petzold''s behalf.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement