IRONSOFTWAREHOME
Styl Barcode
using IronBarCode;
using IronSoftware.Drawing;

// Create a barcode
var myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8);

// Resize in pixels
myBarcode.ResizeTo(400, 100);

// Set margins in pixels
myBarcode.SetMargins(5, 5, 5, 5);

// Set the color of the barcode
myBarcode.ChangeBarCodeColor(Color.Red);

// And save our barcode as an image:
myBarcode.SaveAsImage("EAN8.jpeg");

// Another supported feature is Mil Sizing
// Mil is a measurement unit used by the barcode scanner manufacturers to specify the minimum of one barcode bar, and at what distance the barcode can be scanned.
// It represents (1 / 1000)th of an inch
var barcodeResizeInMils = BarcodeWriter.CreateBarcode("5941623002802", BarcodeEncoding.Code128);

// This will resize the barcode width to 13 mil, at 96 DPI by default
barcodeResizeInMils.ResizeToMil(13);

// This will resize the barcode width to 10 mil and and the height to 1.5 inches, at 96 DPI by default
barcodeResizeInMils.ResizeToMil(10, 1.5);

// This will resize the barcode width to 7.5 mil and the height to 2 inches, with the DPI set to 200
barcodeResizeInMils.ResizeToMil(7.5, 2, 200);
Imports IronBarCode
Imports IronSoftware.Drawing

' Create a barcode
Dim myBarcode = BarcodeWriter.CreateBarcode("12345", BarcodeWriterEncoding.EAN8)

' Resize in pixels
myBarcode.ResizeTo(400, 100)

' Set margins in pixels
myBarcode.SetMargins(5, 5, 5, 5)

' Set the color of the barcode
myBarcode.ChangeBarCodeColor(Color.Red)

' And save our barcode as an image:
myBarcode.SaveAsImage("EAN8.jpeg")

' Another supported feature is Mil Sizing
' Mil is a measurement unit used by the barcode scanner manufacturers to specify the minimum of one barcode bar, and at what distance the barcode can be scanned.
' It represents (1 / 1000)th of an inch
Dim barcodeResizeInMils = BarcodeWriter.CreateBarcode("5941623002802", BarcodeEncoding.Code128)

' This will resize the barcode width to 13 mil, at 96 DPI by default
barcodeResizeInMils.ResizeToMil(13)

' This will resize the barcode width to 10 mil and and the height to 1.5 inches, at 96 DPI by default
barcodeResizeInMils.ResizeToMil(10, 1.5)

' This will resize the barcode width to 7.5 mil and the height to 2 inches, with the DPI set to 200
barcodeResizeInMils.ResizeToMil(7.5, 2, 200)
NuGet Download
PM > Install-Package BarCode
Styl Barcode

Styl Barcode

W IronBarcode masz możliwość zmiany rozmiaru kodów kreskowych, dodawania marginesów, zmiany kolorów i zapisywania ich w różnych popularnych formatach plików. Ponadto, mozna dostosowac ustawienia DPI, aby uzyskac lepsza kontrole nad szczegolami obrazu.

Dostosowywanie wyglądu kodu kreskowego: Różne metody pozwalają na modyfikację rozmiaru i kolorów kodu kreskowego:

  • ResizeTo(500, 500): Zmienia rozmiar kodu kreskowego na 500x500 pikseli.
  • ChangeBarColor: Zmienia kolor paskow w kodzie kreskowym.
  • ChangeBackgroundColor: Zmienia kolor tla.
Dowiedz się, jak dostosować style kodów kreskowych za pomocą IronBarcode
Zobacz na GitHubie

Gotowy, aby rozpocząć?

Nuget Downloads 2,422,100Wersja:2026.9właśnie wydany

Key in blue circle

Uzyskaj natychmiast swój darmowy 30-dniowy Klucz Testowy.

Your trial license will be sent to your email address

Brak ograniczeń. 100% dostępności. Bez karty kredytowej.

bullet_checkedNie wymaga karty kredytowej ani tworzenia kontaBrak ograniczeń. 100% dostępności. Bez karty kredytowej.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Zarezerwuj swoje darmowe Demo na żywo
Booking Badge

Zaufane przez miliony inżynierów na całym świecie

Logotypy klientów Iron Software
Otrzymaj swoje Konsultacja Bez Zobowiązań
Wypełnij poniższy formularz lub wyślij e-mail na sales@ironsoftware.com
Twoje dane zawsze będą utrzymywane w tajemnicy.
Zaufane przez miliony inżynierów na całym świecie
Logotypy klientów Iron Software
Otrzymaj swój darmowy Klucz Próbny na 30 dni natychmiast.
Nie wymaga karty kredytowej ani tworzenia konta