2D streckkodsskrivare för .NET
Introduktion till 2D Barcode Writer för .NET
Den 2D Barcode Writer för .NET är en plugin som gör det möjligt för utvecklare att generera 3D-barkoder i sina .Net-applikationer.Denna guide ger en översikt över de tillgängliga funktionerna och förklarar hur man utför vanliga uppgifter med hjälp av kodexempel.
Stödda 2D Barcode Typer
Den 2D Barcode Writer för .NET stöder flera typer av 2-D-barkoder, inklusive:
- QR koder
- Uppgifter Matrix
- PDF417
Skapa 2D barkoder
För att generera en 2D-barkod kan du använda BarcodeGenerator
Denna klass ger flera egenskaper som gör att du kan anpassa barkoden, till exempel CodeText
, EncodeTypes
, och 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);
Anpassning av 2D barkoder
Du kan anpassa utseendet på 2D-barkoden genom att använda olika egenskaper som tillhandahålls av BarcodeGenerator
Klass. Till exempel kan du ändra bakgrundsfärgen på rutan.
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);