在 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 剛發表






