OnPaint Event
-
Hi everybody I have a panel in my form, I used backgraound image for my panel. In the Panel OnPaint event body, I draw ellipse with various position and dimension on each times. So I use a timer, On the OnTimer event I Refresh panel for clearing previous ellipse and draw new ellipse with new parameters. when form refreshed a bit jumping occurred in my background image, since I use mentioned operation every second, these jumping annoy the user. I want to know how can disappear these jumping, Maybe for clearing prior ellipse use another method instead refresh or invalidate.
Best Regards, Reza Shojaee
-
Hi everybody I have a panel in my form, I used backgraound image for my panel. In the Panel OnPaint event body, I draw ellipse with various position and dimension on each times. So I use a timer, On the OnTimer event I Refresh panel for clearing previous ellipse and draw new ellipse with new parameters. when form refreshed a bit jumping occurred in my background image, since I use mentioned operation every second, these jumping annoy the user. I want to know how can disappear these jumping, Maybe for clearing prior ellipse use another method instead refresh or invalidate.
Best Regards, Reza Shojaee
You can turn on double buffering. this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer,true);
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.