IRONSOFTWAREHOME
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 20,274,271Version:2025.3just released

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronDrawing
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required