Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » BackPaint question
BackPaint question [message #615] |
Fri, 20 January 2006 17:45 |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
While analyzing the AnimatedHello example I found this method:
HelloWorld::HelloWorld()
{
SetTimeCallback(-40, THISBACK(Animate));
BackPaint();
Zoomable().Sizeable();
SetRect(0, 0, 260, 80);
}
Why is the BackPaint() there? It is supposed to mean that the framework should clear the full widget to the backround color before calling Paint, right? There seems to be no need for that, since the HelloWorld::Paint starts with painting the whole area with the white color.
A related question: Would it be logical for flickeing to occur in the AnimatedHello application, especially since the background seems to be painted two times with different color? I don't see any flicker, but how is it avoided?
|
|
|
Re: BackPaint question [message #617 is a reply to message #615] |
Fri, 20 January 2006 22:07 |
|
Backpaint is here to avoid flickering between that white rectangle and the text (because recatnle cover the whole window area)! If you have fast computer you may not see that flickering.
|
|
|
|
Re: BackPaint question [message #626 is a reply to message #618] |
Sun, 22 January 2006 21:18 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
FULLBACKPAINT just paints it in the "backpaint" buffer and transfers the result to the screen. Means, if some areas in the window are to be repainted (U++ always cumulates are "damaged" areas and defers it as much as possible, in Win32 that is done automatically and repainting is done when WM_PAINT for top-level Ctrl is recieved, in X11 a lot of additional code is inbolved).
In other words, without FULLBACKPAINT all Paint routines draw directly to the screen, which can result in flickering.
With FULLBACKPAINT, help buffer is used, Paint paints to it and then it is transfered to the screen.
Alternative mode backpaints areas covered by transparent Ctrls only, as those are places where flickering is most visible. This mode is default (and it is also the only reason for "Ctrl::Transparent" flag to exist).
(Remaining option, EXCLUDEPAINT, is just "misuse" that reuses the flag to support special cases, like OLE controls that have WM_PAINT based painting).
Sorry for confusion. Please feel free to improve on docs if you are going to fix grammar there.
|
|
|
Goto Forum:
Current Time: Fri Mar 29 15:54:22 CET 2024
Total time taken to generate the page: 0.01364 seconds
|