Using C # language, WinForm technology, imitation 360 installation animation

Source: Internet
Author: User

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);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.