
int tem=0;
int bmqmcs = 0;
private void timer1_Tick(object sender, EventArgs e)
{
SadInputCount();//采集编码器脉冲
bmqmcs = SadInputCount(); //实时采集编码器脉冲数
tem++;
Point[]Point = new Point[40000];//定义数组
Point[tem].X = tem;
Point[tem].Y = Convert.ToInt16(bmqmcs);//用编码器脉冲数做Y坐标
Graphics qs = pictureBox1.CreateGraphics();
qs.DrawLines(new Pen(Color.Red,1),Point);//画实时曲线
}
现在能采集到编码器脉冲,想画时间脉冲实时曲线。用脉冲当Y坐标,tem相当时间做X坐标。为什么画线都是从原点开始,不是连续的呢?数组定义的不对吗?还有point[]X和point[]Y必须是整数吗?高手指教