如何实现图形的旋转 怎么动态的让一条线或者一个图形旋转,谢谢各位 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考下面的代码吧:protected override void OnLoad(EventArgs e){ base.OnLoad(e); Timer time = new Timer(); time.Enabled = true; time.Interval = 50; time.Tick += new EventHandler(time_Tick);}float angle = 0;void time_Tick(object sender, EventArgs e){ if (angle < 360) { angle = angle + 1; } else { angle = 0; } this.Invalidate();}protected override void OnPaint(PaintEventArgs e){ base.OnPaint(e); e.Graphics.TranslateTransform(this.Width / 2, this.Height / 2); e.Graphics.RotateTransform(angle); Rectangle rect = new Rectangle(50, 50, 50, 20); e.Graphics.DrawRectangle(SystemPens.ControlText, rect);} C# serialport读写多个三菱fx系列plc 银行,医院,政府的一些触摸屏终端用windows系统的多吗 菜鳥想問問數據庫的幾個問題 面试题目,呵呵,请大家解答! 寻求blog,要求不是很高,只要支持多用户,能发文章,发评论/aspx格式... crystallreport 注册码!! 再问datagrid问题 求一个多线程调用的写法,有100个任务,限定并发数为5 怎样获取ie上asp中的某个字符串?急 我用C#开发的web程序是否可以安装在一台NT4.0,IIS版本为4.0的机器上? System.IndexOutOfRangeException类型的异常 两个小问题
{
base.OnLoad(e);
Timer time = new Timer();
time.Enabled = true;
time.Interval = 50;
time.Tick += new EventHandler(time_Tick);
}float angle = 0;
void time_Tick(object sender, EventArgs e)
{
if (angle < 360)
{
angle = angle + 1;
}
else
{
angle = 0;
}
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.TranslateTransform(this.Width / 2, this.Height / 2);
e.Graphics.RotateTransform(angle);
Rectangle rect = new Rectangle(50, 50, 50, 20);
e.Graphics.DrawRectangle(SystemPens.ControlText, rect);
}