Example #1
0
        public void SetOcrLanguage(string language)
        {
            OcrLanguages langus = new OcrLanguages();
            string       tag    = langus.GetTag(language);

            ocrLanguage = new UwpLanguage(tag);
            engine      = UwpOcrEngine.TryCreateFromLanguage(ocrLanguage);

            if (engine == null)
            {
                ocrLanguage = null;
                throw new InvalidOperationException(errMsgFailedToSetLanguage);
            }
        }
Example #2
0
        public IList <string> GetAvailableLanguages()
        {
            OcrLanguages langus = new OcrLanguages();

            IList <string> languages = new List <string>();
            var            list      = UwpOcrEngine.AvailableRecognizerLanguages;

            if (list.Count != 0)
            {
                foreach (var item in list)
                {
                    var lang = langus.GetLanguage(item.LanguageTag);
                    languages.Add(lang);
                }
            }
            return(languages);
        }