我正在尝试查看给出的源代码 http://bytes.com/topic/net/answers/608057-capturing-video-webcam但是当我尝试复制并粘贴我的项目时,显示错误说
错误1可访问性不一致: 参数类型 'View_Box.WebCamCapture.WebcamEventArgs' 不像代表那么容易接近 'View_Box.WebCamCapture.WebCamEventHandler'
我的代码到底出了什么问题?
下面是我正在尝试编译的代码片段,并且我还突出显示了使用开始箭头和结束箭头发生错误的行。
[System.Drawing.ToolboxBitmap(typeof(WebCamCapture), "CAMERA.ICO")] // toolbox bitmap
[Designer("Sytem.Windows.Forms.Design.ParentControlDesigner,System.Design", typeof(System.ComponentModel.Design.IDesigner))] // make composite
public class WebCamCapture : System.Windows.Forms.UserControl
{
private System.ComponentModel.IContainer components;
private System.Windows.Forms.Timer timer1;
// property variables
private int m_TimeToCapture_milliseconds = 100;
private int m_Width = 320;
private int m_Height = 240;
private int mCapHwnd;
private ulong m_FrameNumber = 0;
private class WebcamEventArgs
{
public Image WebCamImage;
}
// global variables to make the video capture go faster
private WebCamCapture.WebcamEventArgs x = new WebCamCapture.WebcamEventArgs();
private IDataObject tempObj;
private System.Drawing.Image tempImg;
private bool bStopped = true;
// event delegate
-->Error in the below line
public delegate void WebCamEventHandler(object source, WebCamCapture.WebcamEventArgs e);
<--
// fired when a new image is captured
public event WebCamEventHandler ImageCaptured;
#region API Declarations
#region Camera API Constants
答案 0 :(得分:0)
我找到了问题的答案......
<强>解决方案强>
类WebcamEventArgs,它早先是私有的,所以我改为公开。现在一切正常;)