private void CreateCamera() { try { var roi = new RegionOfInterest(XMin, YMin, Width, Height); _cameraPtr = GenieNanoDll.CreateCamera( _options.Value.CameraName, roi, _frameArrived, _cameraConnected, _cameraDisconnected); } catch (DllNotFoundException) { _logger.LogError( "Failed to initialize GenieNanoCamera: The Camera SDK is not installed"); PeripheralState = PeripheralState.Error; return; } if (_cameraPtr.Equals(IntPtr.Zero)) { _logger.LogError( "Failed to initialize GenieNanoCamera: Camera was not found on the network"); PeripheralState = PeripheralState.NotConnected; return; } PeripheralState = PeripheralState.Ready; try { ApplyOptions(); } catch (KickermatException ex) { _logger.LogError(ex.Message); } }
public static extern IntPtr CreateCamera(string name, RegionOfInterest roi, FrameArrived frameArrived, CameraConnected connected, CameraDisconnected disconnected);