Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created July 22, 2011 01:26
Show Gist options
  • Save follesoe/1098656 to your computer and use it in GitHub Desktop.
Save follesoe/1098656 to your computer and use it in GitHub Desktop.
Constructor for QR scanner example
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