Esempio n. 1
0
        private async void InitCamera_Click(object sender, RoutedEventArgs e)
        {
            captureManager = new MediaCapture();
            await captureManager.InitializeAsync();

            // Can only read capabilities after capture device initialized.

            VideoDeviceController videoDeviceController = captureManager.VideoDeviceController;

            SceneModeControl sceneModeControl = _scene = videoDeviceController.SceneModeControl;
            RegionsOfInterestControl regionsOfInterestControl = _regions = videoDeviceController.RegionsOfInterestControl;

            bool isFocusSupported = _focus = videoDeviceController.FocusControl.Supported;
            bool isIsoSpeedSupported = _iso = videoDeviceController.IsoSpeedControl.Supported;
            bool isTorchControlSupported = _torch = videoDeviceController.TorchControl.Supported;
            bool isFlashControlSupported = _flash = videoDeviceController.FlashControl.Supported;

            if (_scene != null)
            {
                foreach (CaptureSceneMode mode in _scene.SupportedModes)
                {
                    string t = mode.ToString();
                }
            }

            if (_regions != null)
            {
                bool autoExposureSupported = _regions.AutoExposureSupported;
                bool autoFocusSupported = _regions.AutoFocusSupported;
                bool autoWhiteBalanceSupported = _regions.AutoWhiteBalanceSupported;
                uint maxRegions = _regions.MaxRegions;
            }
        }
Esempio n. 2
0
        internal bool Start(RegionsOfInterestControl regionsOfInterestControl)
        {
            if (Activated)
            {
                return(false);
            }

            Activated = true;

            RegionsOfInterestControl = regionsOfInterestControl;
            Stopwatch  = Stopwatch.StartNew();
            WorkerTask = Task.Run(Worker);

            return(true);
        }