Save Images with Different Processing in IronOCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

Wie kann ich ein Bild mit verschiedenen Bildverarbeitungen/Bildfiltern speichern?

Wenden Sie das folgende einfache Codebeispiel an:

// 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

Eine vollständige Liste der in IronOCR verfügbaren Bildoptimierungsfilter finden Sie unter IronOCR Image Filters.

MSDN-Style Klassen-Dokumentation - OcrInput Methoden

Curtis Chau
Technischer Autor

Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender ...

Weiterlesen
Bereit anzufangen?
Nuget Downloads 5,044,537 | Version: 2025.11 gerade veröffentlicht