IRONSOFTWAREHOME
Write 1-BPP Barcodes Images
using IronBarCode;

var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8);

myBarcode.SaveAs1BppBitmap("1bppImage.bmp");
var byteData = myBarcode.To1BppBinaryData();
var anyBitmap = myBarcode.To1BppImage();
Imports IronBarCode

Dim myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8)

myBarcode.SaveAs1BppBitmap("1bppImage.bmp")
Dim byteData = myBarcode.To1BppBinaryData()
Dim anyBitmap = myBarcode.To1BppImage()
NuGet Download
PM > Install-Package BarCode
Write 1-BPP Barcodes Images

Write 1-BPP Barcodes Images

A 1bpp image is a monochrome image that can display only two colors, typically black and white. Each pixel in the picture is represented by a single bit, where "0" may represent black and "1" may represent white, or vice versa. This format is best suited for scenarios where speed and accuracy are essential, and it is intended to be read by machines. In this code example, we will demonstrate how to convert the barcode we created into a 1bpp image for maximum contrast and reliability when scanning.

5-Step Guide to Converting Barcodes into 1BPP Barcode Images

  • using IronBarCode;
  • var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8);
  • myBarcode.SaveAs1BppBitmap("1bppImage.bmp");
  • var byteData = myBarcode.To1BppBinaryData();
  • var anyBitmap = myBarcode.To1BppImage();

Code Explanation

We first import the IronBarcode library, then we generate a barcode using the BarcodeWriter.CreateBarcode method. We pass two variables to the method: the string value and the type of the barcode. In the example above, these are "12345" and EAN8, respectively.

After creating the barcode, we can call the save method SaveAs1BppBitmap and pass it a file name. Doing this saves the barcode as a 1bpp Bitmap with the name being the file name it's saved as.

Aside from saving it directly to a Bitmap, there are also alternative save methods. IronBarcode supports saving the barcode as 1bpp binary data using the To1BppBinaryData method. Converting to binary data allows you to pass the variable as binary data to other sections of the application or integrate with existing code bases. Furthermore, IronBarcode also supports saving the barcode as a 1-bit-per-pixel (1bpp) image using the To1BppImage method.

View on GitHub

Ready to Get Started?

Nuget Downloads 2,472,280Version:2026.10just 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 IronBarcode
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
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
C# NuGet Library for PDF
Install with NuGet

Version: 2026.10

PM > Install-Package BarCode
nuget.org/packages/BarCode/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronBarCode"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.10

  1. Download and unzip IronBarCode to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronBarCode.dll"

Licenses from $999