需要帮助来识别一些代码...... [英] Need a help to identify some codes...

查看:70
本文介绍了需要帮助来识别一些代码......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了一些图像处理技术并使用下面的代码将视频输入到图片框中...但我无法理解代码的第二行... 任何人都可以解释该代码将会发生什么...... ???





I tried some image processing techniques and use below codes to get video feed into a picture box...but i can't understand the second line of the code...Can any one explain that what will happen of that code...???


private VideoCaptureDevice capureDevice;
capureDevice.NewFrame += new NewFrameEventHandler(capureDevice_NewFrame);

public  void capureDevice_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
	//moethod codes gose here 
}

推荐答案

它只是为VideoCapture设备的实例添加一个事件处理程序。 />
或者它会 - 如果它不只是抛出一个空引用异常因为你没有分配一个实例,只是声明一个变量来引用该实例。



但是如果你有,那么只要该特定实例发出NewFrame事件的信号,框架就会调用你的 capureDevice_NewFrame 方法。
All it does is add an event handler to the instance of the VideoCapture Device.
Or it would - if it didn't just throw a "null reference exception" because you haven't allocated an instance, just declared a variable to refer to the instance.

But if you had, then whenever that specific instance signals a "NewFrame" event, the framework will call your capureDevice_NewFrame method.


感谢您的回复......在这里我只写了代码的一些重要部分,我只想知道代码是如何工作的。我没有正确地了解事件处理的工作原理。你能解释一下代码的工作过程吗?我非常感谢你的宝贵答案..
Thanks for replying...here i wrote only some important parts of the code and i only wanted to know that how that code work. I didn't get that correctly how that event handling work. Can you explain more about the working process of the code, and i really grateful for your valuable answer..


这篇关于需要帮助来识别一些代码......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆