Created
July 22, 2011 01:26
-
-
Save follesoe/1098656 to your computer and use it in GitHub Desktop.
Constructor for QR scanner example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly DispatcherTimer _timer; | |
private readonly ObservableCollection<string> _matches; | |
private PhotoCameraLuminanceSource _luminance; | |
private QRCodeReader _reader; | |
private PhotoCamera _photoCamera; | |
public MainPage() | |
{ | |
InitializeComponent(); | |
_matches = new ObservableCollection<string>(); | |
_matchesList.ItemsSource = _matches; | |
_timer = new DispatcherTimer(); | |
_timer.Interval = TimeSpan.FromMilliseconds(250); | |
_timer.Tick += (o, arg) => ScanPreviewBuffer(); | |
} | |
protected override void OnNavigatedTo(NavigationEventArgs e) | |
{ | |
_photoCamera = new PhotoCamera(); | |
_photoCamera.Initialized += OnPhotoCameraInitialized; | |
_previewVideo.SetSource(_photoCamera); | |
CameraButtons.ShutterKeyHalfPressed += (o, arg) => _photoCamera.Focus(); | |
base.OnNavigatedTo(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment