IronOCRで異なる処理を施した画像を保存する
This article was translated from English: Does it need improvement?
TranslatedView the article in English
異なる画像処理/画像フィルターを適用した画像を保存するにはどうすればよいですか?
次の簡単なコード例を適用します。
// Create a new instance of OcrInput from a text box input for file path.
OcrInput input = new OcrInput(browsFile_txt.Text);
// Apply a grayscale filter to the image.
input.ToGrayScale();
// Iterate through each page in the OcrInput object.
foreach (var p in input.Pages)
{
// Save each processed page as an image with a unique timestamped filename.
p.SaveAsImage($"{outputPath}\\{DateTime.Now.ToString("yyyyMMddHHmmss")}.png");
}// Create a new instance of OcrInput from a text box input for file path.
OcrInput input = new OcrInput(browsFile_txt.Text);
// Apply a grayscale filter to the image.
input.ToGrayScale();
// Iterate through each page in the OcrInput object.
foreach (var p in input.Pages)
{
// Save each processed page as an image with a unique timestamped filename.
p.SaveAsImage($"{outputPath}\\{DateTime.Now.ToString("yyyyMMddHHmmss")}.png");
}' Create a new instance of OcrInput from a text box input for file path.
Dim input As New OcrInput(browsFile_txt.Text)
' Apply a grayscale filter to the image.
input.ToGrayScale()
' Iterate through each page in the OcrInput object.
For Each p In input.Pages
' Save each processed page as an image with a unique timestamped filename.
p.SaveAsImage($"{outputPath}\{DateTime.Now.ToString("yyyyMMddHHmmss")}.png")
Next p$vbLabelText $csharpLabel
IronOCR で使用できる画像最適化フィルターの完全なリストについては、 "IronOCR 画像フィルター"を参照してください。
MSDN スタイルのクラスドキュメント - OcrInput メソッド
準備はできましたか?
Nuget ダウンロード 5,246,844 | バージョン: 2025.12 リリース






