private async void CaptureAndShowResult(bool readText) { if (!_inited || _busy) { return; } ShowBusyIndicator(true); var resultCv = await _computerVisionProcessor.CaptureAndAnalyze(this, _mediaCapture, _withPreview, readText); await TextToSpeech(resultCv.Item1); await _flowProcessor.FlowMessage(resultCv.Item2, resultCv.Item1, readText); InvokeOnMain(() => ShowBusyIndicator(false)); }
private async void TextButton_Click(object sender, RoutedEventArgs e) { var fileOpenPicker = new FileOpenPicker { ViewMode = PickerViewMode.Thumbnail, SuggestedStartLocation = PickerLocationId.PicturesLibrary }; fileOpenPicker.FileTypeFilter.Add(".png"); fileOpenPicker.FileTypeFilter.Add(".jpg"); fileOpenPicker.FileTypeFilter.Add(".jpeg"); fileOpenPicker.FileTypeFilter.Add(".bmp"); var file = await fileOpenPicker.PickSingleFileAsync(); if (file != null) { var fp = new FlowProcessor(); await fp.FlowMessage(file, "sample result", false); } }