P
Peter Oliphant
I'm drawing graphics using the Graphics object one can grab in a Form's
Paint event. But I'm getting a weird thing happening...
These graphic shapes flicker (even if unchanged). UNLESS- I created a timer
and had the timer update a Label on the form with timer interval set to 10.
Now all the shapes I draw in the Paint event of the form draw WITHOUT
flicker!!!
What is updating a Label doing that is preventing flicker? Is it somehow
calling Paint more often? Why are the graphic shapes NOT being drawn at
times (which I assume is the cause of the flicker, 'frames' (or periods of
time) where the graphics aren't being displayed)?
This is weird because I'm not use to having to draw MORE objects to
elliminate flicker...hehe! Like I said, it's likely because Control's (such
as Label) somehow know what to do with the concepts of invalidated regions,
refresh, and update such that the Form always displays its Graphic objects
without flicker!!!
What can >I< do to accomplish the same thing without having to update a
Control? My solution right now is to create a bogus Label, place it off
screen (which by the way still elliminates the flicker even though its not
drawn!), add a Timer, make Timer update the color of the Label with timer
interval of 10. That is, whatever Label is doing, force it to do it on a
bogus object. But I'd rather do whatever its doing 'purely' to accomplish
this without creating the bogus Label!
Help, and thanks! : )
[==P==]
Paint event. But I'm getting a weird thing happening...
These graphic shapes flicker (even if unchanged). UNLESS- I created a timer
and had the timer update a Label on the form with timer interval set to 10.
Now all the shapes I draw in the Paint event of the form draw WITHOUT
flicker!!!
What is updating a Label doing that is preventing flicker? Is it somehow
calling Paint more often? Why are the graphic shapes NOT being drawn at
times (which I assume is the cause of the flicker, 'frames' (or periods of
time) where the graphics aren't being displayed)?
This is weird because I'm not use to having to draw MORE objects to
elliminate flicker...hehe! Like I said, it's likely because Control's (such
as Label) somehow know what to do with the concepts of invalidated regions,
refresh, and update such that the Form always displays its Graphic objects
without flicker!!!
What can >I< do to accomplish the same thing without having to update a
Control? My solution right now is to create a bogus Label, place it off
screen (which by the way still elliminates the flicker even though its not
drawn!), add a Timer, make Timer update the color of the Label with timer
interval of 10. That is, whatever Label is doing, force it to do it on a
bogus object. But I'd rather do whatever its doing 'purely' to accomplish
this without creating the bogus Label!
Help, and thanks! : )
[==P==]