On Oct 1, 7:03*pm, JMe...@gmail.com wrote:
I am drawing simple graphics on a custom control which has a static
background image. *When I try to rapidly (maybe 50 times per second)
redraw the graphics the computer can't keep up. *There is no issue
when I just draw graphics on a control with a plain color as the
background but with an image set as the background it seems the
control redraws the background each time I refresh which makes its
performance poor. *Is there a way to improve this situation?
Thanks,
Jo
I'm not sure what all you're drawing, but I believe you can just set
the invalidation region on the control to only invalidate where you
are drawing. This would be helpful if you are only using one small
area of the control, but wouldn't do much if you were drawing over the
entire control.
One other thing that may or may not help (I'm a web developer so I've
been away from GDI+ for a while) is to use the graphics object to draw
the background as well. It could be that if it's all being done in one
place, you might have less parts spawning a redraw.
Thanks,
Seth Rowe [MVP]
http://sethrowe.blogspot.com/