当程序在Windows 10 IoT核心版上运行时,为什么此列表为空?

时间:2019-07-24 14:01:06

标签: uwp windows-10-iot-core

有一个List在Windows 10 Iot Core运行时为空,但在Windows 10 Iot Core运行时具有值。 该程序是这个演示: 此演示https://github.com/MicrosoftDocs/windows-topic-specific-samples/archive/uwp-ink-handwriting-reco.zip

然后在msdn上搜索InkRecognizerContainer类。 https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Input.Inking.InkRecognizerContainer msdn表示此类Windows 10要求。

    // inkRecognizerContainer is null if a recognition engine is not available.
                if (!(inkRecognizerContainer == null))
                {
                    // Recognize all ink strokes on the ink canvas.
                    //when it run at windows 10.recognitionResults have value.but recognitionResults is empty
                    //when run at windows 10 iot core.
                    IReadOnlyList<InkRecognitionResult> recognitionResults =
                        await inkRecognizerContainer.RecognizeAsync(
                            inkCanvas.InkPresenter.StrokeContainer,
                            InkRecognitionTarget.All);
                    // Process and display the recognition results.
                    if (recognitionResults.Count > 0)
                    {
                        string str = "Recognition result\n";
                        // Iterate through the recognition results.
                        foreach (var result in recognitionResults)
                        {
                            // Get all recognition candidates from each recognition result.
                            IReadOnlyList<string> candidates = result.GetTextCandidates();
                            str += "Candidates: " + candidates.Count.ToString() + "\n";
                            foreach (string candidate in candidates)
                            {
                                str += candidate + " ";
                            }
                        }
                        // Display the recognition candidates.
                        recognitionResult.Text = str;
                        // Clear the ink canvas once recognition is complete.
                        inkCanvas.InkPresenter.StrokeContainer.Clear();
                    }
                    else
                    {
                        recognitionResult.Text = "No recognition results.";
                    }
                }

该类在Windows 10 IoT核心版上无法运行吗?还是有其他原因?

1 个答案:

答案 0 :(得分:1)

Windows IoT核心版支持InkRecognizerContainer。从版本16299开始,Windows IoT核心版改进了墨水支持。但是您需要使用兼容的笔数字化仪。兼容的硬件现在也支持多模式交互,例如同时进行笔和触摸。请参考Hardware compatibility list