2D บาร์โค้ด ไวเตอร์ สำหรับ .NET
บทนําใน 2D Barcode Writer สําหรับ .NET
The 2D Barcode Writer for .NET เป็นปลั๊กอินที่ช่วยให้ผู้พัฒนาสามารถสร้างรหัสบาร์ในแอปพลิเคชันของพวกเขา ในคู่มือนี้จะให้รายละเอียดเพิ่มเติมเกี่ยวกับคุณสมบัติที่มีอยู่และอธิบายวิธีการดําเนินการงานทั่วไปโดยใช้ตัวอย่างโค้ด
ประเภทบาร์โค้ด 2D ที่สนับสนุน
เครื่องเขียนบาร์โค้ด 2D สําหรับ .NET สนับสนุนหลายประเภทของรหัสบอร์ด 2d รวมถึง:
- รหัส QR
- Matrix ข้อมูล
- 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 Barcodes
คุณสามารถปรับแต่งรูปร่างของรหัสบาร์ 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);