コード例 #1
0
        public WebCam(string moniker)

        {
            cd = new CaptureDevice();

            cd.VideoSource = moniker;

            cd.NewFrame += new CameraEventHandler(cd_NewFrame);
        }
コード例 #2
0
        public WebCam()

        {
            dshow.FilterCollection filters = new dshow.FilterCollection(dshow.Core.FilterCategory.VideoInputDevice);



            if (filters.Count == 0)

            {
                throw new Exception("No DirectShow filters available for video stream moniker (probably no webcam)");
            }



            cd = new CaptureDevice();



            cd.VideoSource = filters[2].MonikerString;

            cd.NewFrame += new CameraEventHandler(cd_NewFrame);
        }
コード例 #3
0
 // Constructor
 public Grabber(CaptureDevice parent)
 {
     this.parent = parent;
 }