OcrControl.CameraChanged Event
The CameraChanged Event is raised whenever the value of the OcrControl.CameraDeviceId Property changes.
Published date: June 26, 2013
public event EventHandler<FrameCapturedEventArgs> FrameCaptured
<Ocr:OcrControl CameraChanged="MyEventHandler(CameraIdChangedEventArgs e);" ...>
You can use the handler for this event to store the device ID of the current camera.
using Windows.Storage; private void OCR_CameraChanged(object sender, CameraIdChangedEventArgs e) { ApplicationData.Current.LocalSettings.Values["LastCamera"] = OCR.CameraDeviceId; }
You can then use that stored value to select the same camera on startup.
// Get the last selected camera. string cameraId = ApplicationData.Current.LocalSettings.Values["LastCamera"] as string; // Start the camera. await OCR.StartPreviewAsync(cameraId);
Show: