C#计时器传递变量
我怎样才能把密码传给定时器?它说cor_xy_ficheiro在比赛中不存在 看来这对你有帮助。简言之:C#计时器传递变量,c#,image,variables,timer,C#,Image,Variables,Timer,我怎样才能把密码传给定时器?它说cor_xy_ficheiro在比赛中不存在 看来这对你有帮助。简言之: Emgu.CV.Image cvImg = new Emgu.CV.Image<Bgr, Byte>(cor_xy); Emgu.CV.Image cvImg=新Emgu.CV.Image(cor_xy); 在全局域中的方法之外声明它。通过这种方式,它可以通过按钮2\u单击和计时器_ficheiro\u勾选事件访问 Image<Bgr, byte> cor_xy_f
Emgu.CV.Image cvImg = new Emgu.CV.Image<Bgr, Byte>(cor_xy);
Emgu.CV.Image cvImg=新Emgu.CV.Image(cor_xy);
在全局域中的方法之外声明它。通过这种方式,它可以通过按钮2\u单击
和计时器_ficheiro\u勾选
事件访问
Image<Bgr, byte> cor_xy_ficheiro; //declare it outside
private void button2_Click(){
//do something with cor_xy_ficheiro
}
private void timer_ficheiro_Tick(object sender, EventArgs e) { //name must match
//do something with cor_xy_ficheiro
}
无论如何,另一个注意事项是:对于代码,你应该把它作为代码而不是图像放在你的问题中。@user5672706:要使用
cor_xy_ficheiro
内部timer_ficheiro_Tick
你应该将cor_xy_ficheiro
移出按钮2>范围。
Timer timer_ficheiro = new Timer();
timer_ficheiro.Tick += timer_ficheiro_Tick; //event handler
timer_ficheiro.Interval = 1000; //interval in ms
timer_ficheiro.Enabled = true; //This you already put