Trình viết mã vạch 2D cho .NET

Giới thiệu về 2D Barcode Writer cho .NET

The 2D Barcode Writer for .NET là một plugin cho phép các nhà phát triển để tạo ra mã vạch 2d trong các ứng dụng của họ. hướng dẫn này cung cấp một cái nhìn tổng quan về các tính năng có sẵn và giải thích làm thế nào để thực hiện các nhiệm vụ phổ biến bằng cách sử dụng ví dụ mã.

Hỗ trợ 2D Barcode Types

The 2D Barcode Writer for .NET hỗ trợ một số loại mã vạch 3D, bao gồm:

  • Mã QR
  • Dữ liệu Matrix
  • Tải PDF417

Tạo 2D Barcodes

Để tạo một mã thanh 2D, bạn có thể sử dụng BarcodeGenerator lớp này cung cấp một số thuộc tính cho phép bạn tùy chỉnh mã thanh, chẳng hạn như: CodeText, EncodeTypes, và Resolution.

using Aspose.BarCode;

// Create a new instance of BarcodeGenerator
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "http://www.example.com");

// Set the resolution of the barcode
generator.Parameters۔Resolution = 300;

// Save the barcode to an image file
generator.Save("qr_code.png", BarCodeImageFormat.Png);

Tùy chỉnh 2D Barcodes

Bạn có thể tùy chỉnh sự xuất hiện của mã thanh 2D bằng cách sử dụng các thuộc tính khác nhau được cung cấp bởi BarcodeGenerator Ví dụ, bạn có thể thay đổi màu nền của mã thanh.

using Aspose.BarCode;

// Create a new instance of BarcodeGenerator
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "http://www.example.com");

// Set the background color of the barcode
generator.Parameters.BackColor = Color.Blue;

// Set the auto-size mode
generator.Parameters.AutoSizeMode = AutoSizeMode.Nearest;

// Save the barcode to an image file
generator.Save("qr_code.png", BarCodeImageFormat.Png);
 Tiếng Việt