如何将cor_xy_ficheiro传递给计时器?它说cor_xy_ficheiro在比赛中不存在
答案 0 :(得分:0)
似乎这个answer可以帮到你。简而言之:
Emgu.CV.Image cvImg = new Emgu.CV.Image<Bgr, Byte>(cor_xy);
答案 1 :(得分:0)
在全局域中的方法之外声明它。这样,button2_Click
和timer_ficheiro_Tick
事件
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
}
此外,还有三个重要的计时器设置:事件处理程序,间隔和启用。请检查三者是否都存在:
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
无论如何,另一个注意事项:对于代码,你应该把它作为代码放在你的问题中,而不是把它作为图像。