我在pictureBox上加载了一个image,从txt文件中读取了坐标数据后,在image上画了几条直线,这部分我都完成了,现在我想要做的是,当我再按一个键的时候,之前画的直线可以缓慢的改变颜色,就好像对它进行加工一样,加工过的地方变成红色,没加工过的地方还是黑色,颜色的变化一定要缓慢的,一开始我打算用定时器来做,但想想如果要实现缓慢效果,每500毫秒画一小段直线,那么一条长的直线,定时器要调用多少次啊,所以感觉行不通,不知道各位高手有没有什么好的办法可以帮帮我!
解决方案 »
- 【多线程】 C# 能否同时等待 Thread 句柄 和 ManualResetEvent ?
- windows服务 不明原因停止
- 构造函数与控件事件之间参数传递
- 用XmlTestWrite创建的XML中怎么创建兄弟节点?
- C#的WinForm中怎样设置TreeView中不同层级的字体或FontColor
- udpclient的问题
- 怎么在ultrawebgrid控件中的某一列中加入DropDownList控件?最好给段c#的事例代码
- 怎么让winform下的datagrid出现滚动条
- 各位大神谁能帮帮忙
- 怎样阻止程序的二次运行
- 求C#调用C++DLL的例子
- 各位高手看看下面的代码是哪里出问题,为什么更新出错???
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;namespace WindowsApplication2
{
public partial class Form1 : Form
{
Thread mThread;
int iCount = 0; public Form1()
{
InitializeComponent();
mThread = new Thread(new ThreadStart(this.ThreadProcess));
} private void ThreadProcess()
{ while (true)
{
Thread.Sleep(10);
this.textBox1.Text = iCount.ToString();
iCount++;
}
} private void buttonStart_Click_1(object sender, EventArgs e)
{
iCount = 0;
mThread.Start();
} private void buttonStop_Click_1(object sender, EventArgs e)
{
mThread.Suspend();
} private void buttonResume_Click(object sender, EventArgs e)
{
mThread.Resume();
} private void buttonExit_Click(object sender, EventArgs e)
{
mThread.Abort();
this.Close();
this.Dispose();
Application.Exit();
}
}
}
{ while (iConut<10000) //(true)
{
Thread.Sleep(10);
this.textBox1.Text = iCount.ToString();
iCount++;
}
}
不就做完退出了?