public WebCam(string moniker) { cd = new CaptureDevice(); cd.VideoSource = moniker; cd.NewFrame += new CameraEventHandler(cd_NewFrame); }
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); }
// Constructor public Grabber(CaptureDevice parent) { this.parent = parent; }