Ejemplo n.º 1
0
        // <AnalyzeInk>
        private async Task <RecognitionRoot> AnalyzeInk()
        {
            try
            {
                var selectedLanguage           = (ComboBoxItem)LanguageComboBox.SelectedValue;
                var selectedApplicationKind    = (ComboBoxItem)ApplicationKindComboBox.SelectedValue;
                var inkRecognizerClientOptions = new InkRecognizerClientOptions(InkRecognizerClientOptions.ServiceVersion.Preview1)
                {
                    Language        = selectedLanguage.Content.ToString(),
                    ApplicationKind = GetApplicationKind(selectedApplicationKind.Content.ToString())
                };

                var credential    = new InkRecognizerCredential(subscriptionKey);
                var endPoint      = new Uri(inkRecognitionUrl);
                var inkRecognizer = new InkRecognizerClient(endPoint, credential, inkRecognizerClientOptions);

                var response = await inkRecognizer.RecognizeInkAsync(strokeStore.GetStrokes());

                var root = response.Value;
                return(root);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 2
0
        public void TestInkRecognizerClient()
        {
            const string dummySubscriptionKey = "";
            const string url      = "https://api.cognitive.microsoft.com/inkrecognizer";
            Uri          endPoint = new Uri(url);

            var credential          = new InkRecognizerCredential(dummySubscriptionKey);
            var inkRecognizerClient = new InkRecognizerClient(endPoint, credential);

            Assert.IsNotNull(inkRecognizerClient);
        }