2D Штрих-код Writer для .NET
Введення в 2D Barcode Writer для .NET
2D Barcode Writer для .NET є плагіном, який дозволяє розробникам генерувати 3D-баркоди в своїх додатках.Цей посібник дає перегляд доступних функцій і пояснює, як виконувати загальні завдання за допомогою прикладів коду.
Підтримка 2D баркодів
2D Barcode Writer для .NET підтримує декілька типів 3D-баркодів, в тому числі:
- QR код
- Інформаційна матриця
- PDF417
Розробка 2D баркодів
Щоб створити 2D-баркод, можна використовувати BarcodeGenerator
Цей клас надає кілька властивостей, які дозволяють налаштувати бар-код, наприклад, CodeText
, EncodeTypes
, і Resolution
.
using Aspose.BarCode;
// Create a new instance of BarcodeGenerator
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "https://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);
Налаштування 2D баркодів
Ви можете налаштувати зовнішній вигляд 2D-баркоду, використовуючи різні властивості, надані BarcodeGenerator
Наприклад, ви можете змінити колір фону баркоду.
using Aspose.BarCode;
// Create a new instance of BarcodeGenerator
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "https://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);