從 AnyBitmap 讀取位元組
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 下載
PM > Install-Package IronSoftware.System.Drawing
從 AnyBitmap 讀取位元組

從 AnyBitmap 讀取位元組

處理AnyBitmap檔案

使用者可以選擇以位元組來操控AnyBitmap檔案。 IronDrawing程式庫提供用於Get、Export 和ReadAnyBitmap文件位元組的方法。

將要讀取的圖像文件可以使用帶有 AnyBitmap.FromFile(@"FILE_PATH") 的文件路徑加載,並存儲在 AnyBitmap 變數中。 然後可以操作此變數來使用 .GetBytes() 方法獲取位元組,使用 .ExportBytes(AnyBitmap.ImageFormat.Format, 10) 方法導出位元組,並選擇改變影像格式和影像損失程度,並使用 File.ReadAllBytes(@"FILE_PATH") 方法讀取文件的所有位元組。

在 GitHub 查看

準備好開始了嗎?

NuGet 下載次數 22,062,064版本:2026.11剛剛發布