A playground project written in Windows Forms (.NET Core 3.1) that uses Azure Computer Vision to perform Optical Character Recognition (OCR) on images in the Windows Clipboard. The recognised text can then be copied, or sent to a predefined list of Windows processes via the Keyboard Buffer (SendKeys) method.
This project requires you to create a Computer Vision project on Microsoft Azure. For more information on Azure Computer Vision, refer to this link.
After you created a Computer Vision Project on Azure, navigate to the resource, and find the "Keys and Endpoint" option. You need two values from this section:
- Key
- Endpoint
Note down these values as you will require them when configuring Local User Secrets on your dev environment. See the image below for reference.
After pulling the code, you have to configure local user secrets.
In Visual Studio, right-click on your project and click on "Manage User Secrets". This will open your secrets.json file. Paste the following code in your secrets file and enter your Azure Computer Vision key and endpoint mentioned before.
{
"cvApiEndpoint": "Your endpoint here",
"cvApiKey": "Your key here"
}
For more information on user secrets, refer to this documentation
The idea for this project was just to play with OCR capabilities of Azure. With this in mind, you can perform some simple operations using the Windows Forms application like:
- Take screenshots - Credit
- Process text in screenshot
- Output text to process
To modify the precess list, modify the following code in MainWindow.cs
:
ProcessList.DataSource = new List<string> { "N/A", "msedge", "chrome", "notepad" };