Read Bytes from 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 Download
PM > Install-Package IronSoftware.System.Drawing
Read Bytes from AnyBitmap

Read Bytes from AnyBitmap

Working with AnyBitmap Files

Users have the option of manipulating AnyBitmap files in terms of bytes. The IronDrawing library provides methods to Get, Export, and Read bytes of an AnyBitmap file.

The image file to be read can be loaded using a file path with AnyBitmap.FromFile(@"FILE_PATH") and stored in an AnyBitmap variable. This variable can then be manipulated to get bytes using the .GetBytes() method, export bytes with an option to change the image format and degree of image loss using the .ExportBytes(AnyBitmap.ImageFormat.Format, 10) method, and read all bytes of the file using the File.ReadAllBytes(@"FILE_PATH") method.

View on GitHub

Ready to Get Started?

Nuget Downloads 21,099,947Version:2026.11just released