|
Prev: erzieherin im ausland arbeiten Berufskraftfahrer Berufskraftfahrerin STELLENANGEBOTE IN DEUTSCHLAND job suche im ausland Regisseur Regisseurin
Next: How to replace the dataAdapter with tableAdapter?
From: JMecc0 on 3 Jul 2008 12:19 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
From: SurturZ on 3 Jul 2008 21:12 Can you draw the needle on a separate transparent control that overlaps the background image? -- David Streeter Synchrotech Software Sydney Australia "JMecc0(a)gmail.com" wrote: > 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 >
From: JMecc0 on 7 Jul 2008 17:50 I guess I could do that too. Thanks for the tip. I did resolve my issue though by adding Me.Refresh() such that the old drawings could get whisked away. Jo
From: SurturZ on 15 Jul 2008 02:06
I can't believe I haven't noticed it before but the PictureBox control in VS2008 has a ".BackgroundImage" property as well as an ".Image" property. In fact, it's a property of the Control class!!! Maybe this will do what you need? -- David Streeter Synchrotech Software Sydney Australia "JMecc0(a)gmail.com" wrote: > 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 > |