我不明白我做錯了什麼。VB.NET類實現事件
的IDE告訴我
"Class 'CaptureDevice' needs to implement event 'Event NewFrame(sender As Object, e As CameraEventArgs) for 'IVideoSource'.
類 'CaptureDevice' 看起來像這樣:
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.IO
Imports System.Threading
Imports System.Runtime.InteropServices
Imports System.Net
Imports dshow
Imports dshow.Core
Namespace VideoSource
Public Class CaptureDevice
Implements IVideoSource
Private source As String
Private m_userData As Object = Nothing
Private m_framesReceived As Integer
Private thread As Thread = Nothing
Private stopEvent As ManualResetEvent = Nothing
' new frame event '
Public Event NewFrame As CameraEventHandler
'(...)'
End Class
End Namespace
我的班 'IVideoSource' 看起來像這樣:
Namespace VideoSource
'IVideoSource interface'
Public Interface IVideoSource
Event NewFrame As CameraEventHandler
End Interface
End Namespace
有誰看到我錯了什麼地方或者可能錯過了什麼?
非常感謝您的幫助!
你有另一個事件在你的接口中聲明'Event NewFrame(sender As Object,e As CameraEventArgs)'嗎? –
'VideoSource'命名空間中還有'CameraEventHandler'嗎? – Crono
這將有助於閱讀:http://msdn.microsoft.com/en-us/library/cd43d244.aspx –