利用C#语言,winform技术,仿360安装动画
2016-08-26 14:12
183 查看
通过观察可知,360安装动画是几个个圆不停的放大的过程。也就是同心圆半径不同的放大。
我利用五个圆,做出类似的效果,为了,区分效果,我设置五个圆利用不同的画笔。
下面是具体的代码:
这个五个半径做为全局变量
int x1 = 200;
int x2 = 100;
int x3 = 50;
int x4 = 150;
int x5 = 250;
具体的实现放在timer控件中
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);
我利用五个圆,做出类似的效果,为了,区分效果,我设置五个圆利用不同的画笔。
下面是具体的代码:
这个五个半径做为全局变量
int x1 = 200;
int x2 = 100;
int x3 = 50;
int x4 = 150;
int x5 = 250;
具体的实现放在timer控件中
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);
相关文章推荐
- C# Winform 中如何获取本机安装输入法,并设置为默认输出语言,如何打开搜狗输入法和手写板
- C#利用反射技术实现winform界面动态存储
- 网络采集软件核心技术剖析系列(7)---如何使用C#语言搭建程序框架(经典Winform界面,顶部菜单栏,工具栏,左边树形列表,右边多Tab界面)
- [C#]利用VSTO操作Office文档而无需安装Office
- [C#]利用VSTO操作Office文档而无需安装Office
- 利用Java 3D技术播放动画之JMF技术-Java基础-Java-编程开发
- C# 2.0 杂项技术,以及C#语言的未来发展
- C# 2.0 杂项技术,以及C#语言的未来发展(选择自 shoutor 的 Blog )
- [开发语言]C#项目如何制作安装程序
- 在HYPER-V中利用差异磁盘和SYSPREP技术安装多个WINDOWS 2008
- Winform 三层架构例子(3)--利用资源文件实现多国语言(含源代码)
- CSDN中国IT技术指数(语言):Java第一,C#第六
- [C#]利用VSTO操作Office文档而无需安装Office
- CSDN中国IT技术指数(语言):Java第一,C#第六
- C#WinForm制作异形窗体/控件-.NET教程,C#语言
- C#利用ADO.NET技术读取Excel
- [开发语言]C#项目如何制作安装程序
- C# 2.0 杂项技术,以及C#语言的未来发展(选择自 shoutor 的 Blog )
- .net C# 动画技术大全,百叶窗,卷动,积木效果,世界之窗,双缓冲技术
- 关于C#winform应用程序打包(包括数据库的安装)的问题!