public partial class Form1 : Form
{
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer() { Interval = 200};
List<PointF> points = new List<PointF>();
public Form1()
{
InitializeComponent();
this.DoubleBuffered = true;
this.timer.Tick += (o, e) => this.Invalidate();
this.timer.Start();
} protected override void OnPaint(PaintEventArgs e)
{
if (points.Count < 100)
{
int t = points.Count + 1;
float x = t * (float)Math.Cos(t / 5f);
float y = t * (float)Math.Sin(t / 5f);
PointF p = new PointF(this.ClientRectangle.Width / 2 + x, this.ClientRectangle.Height / 2 + y);
points.Add(p);
} if (points.Count > 2)
{
e.Graphics.DrawCurve(Pens.Blue, points.ToArray());
}
}
}
{
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer() { Interval = 200};
List<PointF> points = new List<PointF>();
public Form1()
{
InitializeComponent();
this.DoubleBuffered = true;
this.timer.Tick += (o, e) => this.Invalidate();
this.timer.Start();
} protected override void OnPaint(PaintEventArgs e)
{
if (points.Count < 100)
{
int t = points.Count + 1;
float x = t * (float)Math.Cos(t / 5f);
float y = t * (float)Math.Sin(t / 5f);
PointF p = new PointF(this.ClientRectangle.Width / 2 + x, this.ClientRectangle.Height / 2 + y);
points.Add(p);
} if (points.Count > 2)
{
e.Graphics.DrawCurve(Pens.Blue, points.ToArray());
}
}
}
解决方案 »
- C# backGrundWorker上传图片并且显示进度条
- 请教c#问题
- 急 下载fckeditor之后如果使用需要配置一些什么地方??????????????????
- 判断当前MDI子窗体是否实现了某接口的方法?
- 事务处理的问题
- 做过Windows服务(Windows Services)的进来,小弟有要事请教。
- 赋值问题
- 关于httpWebRequest.GetResponse 下载文件的 404错误
- 我的aspnet权限没有了怎么办?
- C# Winfrom项目,实现from窗体中可以切割成多个布局,在每个布局中打开相应的功能模块应用
- 博客园转载来的一个问题看看高手们如何编程解决。
- C# 线程问题
哇塞,大手 你这个是动态的,有静态的吗 就是以编译成功显示出来就是螺旋线的
x = cos(t) + t * sin(t);
y = sin(t) - t * cos(t);