Hi you all,
I have created a usercontrol with a filledEllipses on a
filledRectangle, using this Paint event:
private void myControl_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
SolidBrush aBrush = new SolidBrush(this.BackColor);
e.Graphics.FillRectangle(aBrush, 10,10, this.Width - 10, this.Height
- 10);
if(m_fOn)
aBrush.Color = m_cOn;
else
aBrush.Color = m_cOff;
e.Graphics.FillEllipse(aBrush, 20, 20, this.Width - 20, this.Width -
20);
aBrush.Dispose();
}
using a Timer I switch m_fOn form true to false and back like this
private void myTimer_Tick(object sender, System.EventArgs e)
{
m_fOn = ! m_fOn;
this.Refresh();
}
Now the control is completly redrown.
For testing I have set the myTimer.interval to 10, and created a
testing application.
I discovered that the memory used by the testing application is
constand increasing.
So I would like to repaint the FillEllipse only.
Any advice on this?
Thanks in advance..
Executor