public Camera(CameraMethods cameraMethods, string name, int index) { _cameraMethods = cameraMethods; _name = name; _index = index; _cameraMethods.OnImageCapture += CaptureCallbackProc; }
public Sensor() { camera = new CameraMethods(); camera.OnImageCapture += new CameraMethods.CaptureCallbackDelegate(camera_OnImageCapture); if (camera.Count == 0) { //no hay camara, iniciar una excepcion throw new Exception("No webcam found!"); } tmrTick = new Timer(new TimerCallback(tmrTick_Tick)); tmrCloseCamera = new Timer(new TimerCallback(tmrCloseCamera_Tick)); tmrTick.Change(Timeout.Infinite, Timeout.Infinite); tmrCloseCamera.Change(Timeout.Infinite, Timeout.Infinite); cameras = new List<CameraInfo>(); for (int x = 0; x < camera.Count; x++) { cameras.Add(camera.GetCameraInfo(x)); } }