P
Peteroid
When the application I'm working on is run it creates a panel with a Paint
event customized to draw primitives (circles, rectangles, etc.), places the
panel on a form, and then launches the form.
The weird part is, the panel, in the instant it becomes visible, seems to
have an image of what this panel had in it the LAST TIME THE APPLICATION WAS
RUN! Since this panel is created anew every time the application is run
('natch), this seems odd to me. I call this the 'ghost image'.
Context, some of which might help:
(*) VS C++.NET 2005 Express
(*) Panel DoubleBuffered = true ;
(*) Panel created in stack syntax in main()
(*) Form created in stack syntax in main()
(*) Custom Paint handler is += to Panel
(*) Custom Paint handler just draws primitives
I've also noticed that everytime the form is moved the panel's Paint event
fires twice. But, it looks like when the form/panel are first shown the
panel's Paint event only fires once. When the form is moved it doesn't
exhibit this behavior (the painted image remains solid and doesn't flicker).
It also (visually) seems to be a 3-part entry. It shows the 'ghost' image,
then it clears (black in my case), then shows my graphics (shows what paint
says). That is, it flickers. If it only showed the 'ghost image' and then my
graphics it would not flicker, as my graphics are static (don't animate at
all)..
It does this in both release and debug, both inside the GUI and stand-alone
exe's.
As all I do is create the panel, set-up panel graphics (paint handler), add
to form, and then show form (in that order), it can't be my code setting
things up 'late' after the form has been shown causing this behavior.
Is this possibly a known bug, or what? I can't imagine there is any code I
could write that could intentionally cause this behavior without it being
some problem in the system somehow.
Any comments? Thanks in advance for responses! : )
[==P==]
event customized to draw primitives (circles, rectangles, etc.), places the
panel on a form, and then launches the form.
The weird part is, the panel, in the instant it becomes visible, seems to
have an image of what this panel had in it the LAST TIME THE APPLICATION WAS
RUN! Since this panel is created anew every time the application is run
('natch), this seems odd to me. I call this the 'ghost image'.
Context, some of which might help:
(*) VS C++.NET 2005 Express
(*) Panel DoubleBuffered = true ;
(*) Panel created in stack syntax in main()
(*) Form created in stack syntax in main()
(*) Custom Paint handler is += to Panel
(*) Custom Paint handler just draws primitives
I've also noticed that everytime the form is moved the panel's Paint event
fires twice. But, it looks like when the form/panel are first shown the
panel's Paint event only fires once. When the form is moved it doesn't
exhibit this behavior (the painted image remains solid and doesn't flicker).
It also (visually) seems to be a 3-part entry. It shows the 'ghost' image,
then it clears (black in my case), then shows my graphics (shows what paint
says). That is, it flickers. If it only showed the 'ghost image' and then my
graphics it would not flicker, as my graphics are static (don't animate at
all)..
It does this in both release and debug, both inside the GUI and stand-alone
exe's.
As all I do is create the panel, set-up panel graphics (paint handler), add
to form, and then show form (in that order), it can't be my code setting
things up 'late' after the form has been shown causing this behavior.
Is this possibly a known bug, or what? I can't imagine there is any code I
could write that could intentionally cause this behavior without it being
some problem in the system somehow.
Any comments? Thanks in advance for responses! : )
[==P==]