J
JMecc0
I am using VB.NET to draw a gauge; i.e. to repeatedly draw a needle
moving on top of a static image of the gauge background whenever the
value changes.
Each time the value changes, I can clear the current graphics to some
color, redraw the gauge background picture with Graphics.DrawImage and
then the needle on top of it with Graphics.DrawPolygon & FillPolygon,
but this seems very wateful as the background never changes.
If I set the control's BackImage as my image and then only draw the
needle though, the last few spots the needle was still show it there
so it looks like there are many needles. These all get cleaned up
periodically when OnPaint is called but only when called by the system
(when I trigger OnPaint no cleanup occurs).
What is the right way to do this?
Thanks,
Jo
moving on top of a static image of the gauge background whenever the
value changes.
Each time the value changes, I can clear the current graphics to some
color, redraw the gauge background picture with Graphics.DrawImage and
then the needle on top of it with Graphics.DrawPolygon & FillPolygon,
but this seems very wateful as the background never changes.
If I set the control's BackImage as my image and then only draw the
needle though, the last few spots the needle was still show it there
so it looks like there are many needles. These all get cleaned up
periodically when OnPaint is called but only when called by the system
(when I trigger OnPaint no cleanup occurs).
What is the right way to do this?
Thanks,
Jo