Beispiel #1
0
        public CameraSnapshot()
        {
            InitializeComponent();

            if (AvailableDevices.Count == 0)
            {
                foreach (var devices in WebcamDevice.VideoDevices)
                {
                    AvailableDevices.Add(devices);
                }
            }

            SelectedDevice = AvailableDevices.LastOrDefault(id => SelectedDeviceId == id.UsbId)
                             ?? AvailableDevices.LastOrDefault();

            Unloaded += delegate
            {
                SelectedDeviceId     = SelectedDevice?.UsbId;
                Webcam.VideoSourceId = "";
            };
        }