By observation, the 360 installation of animation is a few rounds of continuous amplification process. That is, the concentric circle radius of different amplification.
I use five circles to make a similar effect, in order to differentiate effects, I set five circles to use different brushes.
The following are the specific code:
This five radius is a global variable.
int x1 = 200;
int x2 = 100;
int x3 = 50;
int x4 = 150;
int x5 = 250;
The specific implementation is placed in the timer control
X1 = x1 + 10;
if (X1 > 300) {
x1 = 50;
}
x2 = x2 + 10;
if (x2 > 300)
{
x2 = 50;
}
x3 = x3 + 10;
if (x3 > 300)
{
x3 = 50;
}
x4 = x4 + 10;
if (x4 > 300)
{
x4 = 50;
}
X5 = x5 + 10;
if (X5 > 300) {
x5 = 50;
}
This. Refresh ();
Graphics GHS1 = this. CreateGraphics ();
Graphics GHS2 = this. CreateGraphics ();
Graphics GHS3 = this. CreateGraphics ();
Graphics GHS4 = this. CreateGraphics ();
Graphics GHS5 = this. CreateGraphics ();
Pen myPen1 = new Pen (Color.firebrick, 2);
Pen myPen2 = new Pen (color.yellow, 2);
Pen MyPen3 = new Pen (color.forestgreen, 2);
Pen myPen4 = new Pen (Color.fuchsia, 2);
Pen myPen5 = new Pen (Color.goldenrod, 2);
Ghs1. DrawEllipse (MyPen1, 400-X1/2, 300-X1/2, X1, x1);
Ghs2. DrawEllipse (MyPen2, 400-X2/2, 300-X2/2, x2, x2);
GHS3. DrawEllipse (MyPen3, 400-X3/2, 300-X3/2, X3, x3);
Ghs4. DrawEllipse (MyPen4, 400-X4/2, 300-X4/2, X4, x4);
Ghs5. DrawEllipse (MyPen5, 400-X5/2, 300-X5/2, X5, X5);