Save Images with Different Processing in IronOCR

This article was translated from English: Does it need improvement?
Translated
View 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-Style Class Documentation - IronOcrInputメソッド

Curtis Chau
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

準備はいいですか?
Nuget ダウンロード 5,044,537 | バージョン: 2025.11 ただ今リリースされました