Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created September 18, 2011 23:15
Show Gist options
  • Select an option

  • Save anaisbetts/1225700 to your computer and use it in GitHub Desktop.

Select an option

Save anaisbetts/1225700 to your computer and use it in GitHub Desktop.
private async void OnWebcamButton(object sender, RoutedEventArgs e)
{
var captureUi = new CameraCaptureUI();
var result = await captureUi.CaptureFileAsync(CameraCaptureUIMode.Photo);
var file = await result.OpenForReadAsync();
var reader = new DataReader(file);
byte[] data = new byte[reader.UnconsumedBufferLength];
await reader.LoadAsync(reader.UnconsumedBufferLength);
reader.ReadBytes(data);
Debug.Text = String.Format("Buffer is {0} bytes", data.Length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment