Is using Windows.Media.Ocr Only support for UWP app?
Asked Answered
S

2

6

I'm trying to find words in image and I found this library using Windows.Media.Ocr.

MS gives really good library using Windows.Media.Ocr but I can't use it in winform or wpf application project.

how can i load using Windows.Media.Ocr; and use it in winform or wpf project?

I got this error when I tried to add it in winform project.

enter image description here

after downloading UWPDesktop from nuget, I got this another error.

I am working at windows 10.

enter image description here

Sennet answered 27/9, 2018 at 13:17 Comment(0)
I
7

Windows.Media.Ocr was originally limited to UWP applications only. Previously, developers had to install the UwpDesktop package via Nuget. However, there is now an official package from Microsoft that replaces the previous UwpDesktop package. Simply add the Microsoft.Windows.SDK.Contracts NuGet package to your project.

Check out this link for more info.

Iodometry answered 18/4, 2020 at 3:56 Comment(0)
H
4

Install the UwpDesktop Nuget package in your WPF application. You should then be able to use the classes in the Windows.Media.Ocr namespace. Please refer to this blog post for more information.

Hamill answered 27/9, 2018 at 13:23 Comment(9)
I just add picture for other error do you know why that happend?Sennet
That's not an error. It's a warning that means that you are currently not using any type in the Windows.Media.Ocr namespace in your code.Hamill
VS said : CS0234 The type or namespace name 'Ocr' does not exist in the namespace 'Windows.Media' (are you missing an assembly reference?). is it not error?Sennet
The Windows.Media.Ocr namespace should exist if you have installed the right NuGet package to the right project. I have verified this myself.Hamill
do i have to install other library like Windows Moblie?Sennet
Does that mean that you don't know how to install a NuGet package? Tools->NuGet Package Manager->Package Manager Console in Visual Studio. And then you type Install-Package UwpDesktop in the prompt.Hamill
PM> Install-Package UwpDesktop Package 'UwpDesktop.10.0.14393.3' already exists in project 'monsterhunter' Time Elapsed: 00:00:00.0477349 but still exist errorSennet
@Sennet So monsterhunter is your project, right? Is it possible that you have multiple project in a solution? Try use Nuget Package Manager->Manage Nuget Package for Solution and verify if UwpDesktop package has been successfully installed to the right project.Fervency
This doesn't work. "The type or namespace name 'Ocr' does not exist in the namespace 'Windows.Media'"Oui

© 2022 - 2024 — McMap. All rights reserved.