コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: swinghu/AirStream
        private async void captureButton_Click(object sender, RoutedEventArgs e)
        {
            if (cameraCapture != null)
            {
                file = await cameraCapture.CapturePhoto();

                IRandomAccessStream imageStream = (await file.OpenStreamForReadAsync()).AsRandomAccessStream();
                BitmapImage         image       = new BitmapImage();
                image.SetSource(imageStream);
                previewField.Source = image;
                await cameraCapture.StopPreview();

                captureField.Source = null;
                cameraCapture.Dispose();
            }
        }