Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created July 22, 2011 01:28
Show Gist options
  • Save follesoe/1098663 to your computer and use it in GitHub Desktop.
Save follesoe/1098663 to your computer and use it in GitHub Desktop.
QR code scanner code
private void ScanPreviewBuffer()
{
try
{
_photoCamera.GetPreviewBufferY(_luminance.PreviewBufferY);
var binarizer = new HybridBinarizer(_luminance);
var binBitmap = new BinaryBitmap(binarizer);
var result = _reader.decode(binBitmap);
Dispatcher.BeginInvoke(() => DisplayResult(result.Text));
}
catch
{
}
}
private void DisplayResult(string text)
{
if(!_matches.Contains(text))
_matches.Add(text);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment