public bool ConfigureCamera() { if (_index > -1 && _index < DllImport.GetNumberOfConnectedWebCams() && _isavailable) { return(DllImport.ConfigureCameraProperties(_index)); } else { return(false); } }
private static void UpdateCameraList() { DllImport.RefreshWebcams(); _numdetectedCameras = DllImport.GetNumberOfConnectedWebCams(); _detectedCameras = new List <WebCam>(); _availableFlags = new List <bool>(); for (int i = 0; i < _numdetectedCameras; i++) { string cameraName = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(DllImport.GetWebCamName(i)); string cameraPath = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(DllImport.GetWebCamPath(i)); bool isAvailable = DllImport.IsWebCamAvailable(i); WebCam camera = new WebCam(cameraName, cameraPath, i, isAvailable); _detectedCameras.Add(camera); _availableFlags.Add(isAvailable); } }