Bytes aus AnyBitmap lesen
using IronSoftware.Drawing;
using System.IO;

// Get, export, and read bytes
AnyBitmap bitmap = AnyBitmap.FromFile(@"FILE_PATH");
byte[] bit = bitmap.GetBytes(); // Get
byte[] export = bitmap.ExportBytes(AnyBitmap.ImageFormat.Tiff, 10);  // Export
byte[] bat = File.ReadAllBytes("file_path"); // Read


NuGet Download
PM > Install-Package IronSoftware.System.Drawing
Bytes aus AnyBitmap lesen

Bytes aus AnyBitmap lesen

Arbeiten mit AnyBitmap-Dateien

Benutzer haben die Möglichkeit, AnyBitmap-Dateien in Bytes zu manipulieren. Die IronDrawing-Bibliothek bietet Methoden zum Get, Export und Read Bytes einer AnyBitmap-Datei.

Die zu lesende Bilddatei kann mithilfe eines Dateipfads mit AnyBitmap.FromFile(@"FILE_PATH") geladen und in einer AnyBitmap-Variablen gespeichert werden. Diese Variable kann dann manipuliert werden, um Bytes mit der .GetBytes()-Methode zu erhalten, die Bytes mit der Option zum Ändern des Bildformats und des Verlustgrades des Bildes mit der .ExportBytes(AnyBitmap.ImageFormat.Format, 10)-Methode zu exportieren und alle Bytes der Datei mithilfe der File.ReadAllBytes(@"FILE_PATH")-Methode zu lesen.

Auf GitHub ansehen

Bereit anzufangen?

Nuget Downloads 21,390,103Version:2026.11gerade veröffentlicht