我对 .NET 编程非常陌生,并且我的代码面临一些问题(可能是微不足道的问题)。我正在开发一个用于在 WP8 上录制视频的演示应用程序。我需要在每帧捕获后进行回调。
我的代码如下:
private AudioVideoCaptureDevice captureDevice;
startcameraPreview()
{
var res = AudioVideoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Back)[0];
captureDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back, res);
captureDevice.PreviewFrameAvailable += new Windows.Foundation.TypedEventHandler<object, EventArgs>(VideoPreviewFrameAvailable);
// NOTE: PreviewFrameAvailable is supposed to be a callback.
}
public void VideoPreviewFrameAvailable(object sender, EventArgs e)
{
return;
}
在编译上述内容时,我收到错误:
No overload for 'VideoPreviewFrameAvailable' matches delegate 'Windows.Foundation.TypedEventHandler<object,System.EventArgs>'
请指导我如何解决此问题。