I am trying to draw a moving circle based on coordinates read from an XML file. At the moment the circle will only draw once. Could someone show me where I'm going wrong?!
The EyeMove method is called within a loop which reads the X and Y strings from the XML and parses to float
public void EyeMove(float x, float y)
{
point = new PointF(x, y);
Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
DrawCircle(e.Graphics, point.X, point.Y);
}
private void DrawCircle(Graphics g, float x, float y)
{
using (Brush semiTransBrush = new SolidBrush(Color.Coral))
{
using (Pen pen = new Pen(Color.Aquamarine, 2))
{
g.DrawEllipse(pen, x, y, 50, 50);
g.FillEllipse(semiTransBrush, x, y, 50, 50);
}
}
}