スクリーンショットを読む
このコード例では、IronTesseract OCR<//code> エンジンを使用して、スクリーンショット画像からテキストを抽出する方法を示します。
準備はできましたか?
Nuget ダウンロード 5,246,844 | バージョン: 2025.12 リリース
using IronOcr;
using System;
using System.Linq;
// Instantiate OCR engine
var ocr = new IronTesseract();
using var inputScreenshot = new OcrInput();
inputScreenshot.LoadImage("screenshotOCR.png");
// Perform OCR
OcrPhotoResult result = ocr.ReadScreenShot(inputScreenshot);
// Output screenshot information
Console.WriteLine(result.Text);
Console.WriteLine(result.TextRegions.First().Region.X);
Console.WriteLine(result.TextRegions.Last().Region.Width);
Console.WriteLine(result.Confidence);Imports IronOcr
Imports System
Imports System.Linq
' Instantiate OCR engine
Private ocr = New IronTesseract()
Private inputScreenshot = New OcrInput()
inputScreenshot.LoadImage("screenshotOCR.png")
' Perform OCR
Dim result As OcrPhotoResult = ocr.ReadScreenShot(inputScreenshot)
' Output screenshot information
Console.WriteLine(result.Text)
Console.WriteLine(result.TextRegions.First().Region.X)
Console.WriteLine(result.TextRegions.Last().Region.Width)
Console.WriteLine(result.Confidence)Install-Package IronOcr
このコード例では、IronTesseract OCR<//code> エンジンを使用して、スクリーンショット画像からテキストを抽出する方法を示します。