Create Micro QR Code in C# using QR Code SDK

Aspose.BarCode มี API ในหลายภาษาโปรแกรม เช่น Java, Python, C++ และอื่นๆ มันมีโซลูชันที่ทรงพลังในการสร้างและประมวลผลบาร์โค้ดและ QR Code โดยโปรแกรม ดังนั้น การทำให้กระบวนการทั้งหมดเป็นอัตโนมัติจะให้ความได้เปรียบทางการแข่งขันกับซอฟต์แวร์ธุรกิจของคุณ ดังนั้นเราจะดำเนินการว่า สร้าง Micro QR Code ใน C# โดยใช้ Aspose.BarCode สำหรับ .NET อย่างไรก็ตาม ในวันข้างหน้าเรายังจะแสดงวิธีการสร้าง/อ่าน QR Code ประเภทอื่น ๆ โดยโปรแกรม ดังนั้นโปรดติดตามบทเรียนที่น่าตื่นเต้นในอนาคตซึ่งมีตัวอย่างโค้ด

ประเด็นต่อไปนี้จะถูกครอบคลุม:

  1. การรวม QR Code SDK
  2. สร้าง Micro QR Code ใน C# - โค้ดตัวอย่าง
  3. ฟรี Micro QR Code Generator - เครื่องมือออนไลน์

การรวม QR Code SDK

ไปที่ คู่มือการติดตั้ง ในกรณีที่มีสถานการณ์ที่ไม่ต้องการ อย่างไรก็ตาม คุณสามารถรันคำสั่งต่อไปนี้ใน NuGet Package Manager หรือดาวน์โหลดไฟล์ DLL ของห้องสมุด C# นี้:

PM> Install-Package Aspose.BarCode 
qr code sdk integration

สร้าง Micro QR Code ใน C# - โค้ดตัวอย่าง

คุณสามารถทำตามขั้นตอนด้านล่างได้ง่ายๆ:

  • สร้างอินสแตนซ์ของคลาส BarcodeGenerator และเริ่มต้นด้วยประเภทสัญลักษณ์ QRcode และข้อความที่จะเข้ารหัส
  • ตั้งขนาดของ QR Code ใน พิกเซล
  • บันทึก(อัตโนมัติเป็นค่าเริ่มต้น) รูปภาพ QR Code ไปยังไฟล์เฉพาะในรูปแบบ PNG
  • ตั้งเวอร์ชัน MicroQR M4 และเรียกใช้เมธอด Save เพื่อบันทึกไฟล์เอาต์พุต

ตัวอย่างโค้ดต่อไปนี้แสดงวิธีการพัฒนา Micro QR code generator ใน C#:

namespace CSharp.MicroQRVersionM4
{
class MicroQRVersionM4
{
static void Main(string[] args)
{
// Define the path to the documents directory.
string path = "/Desktop/";
System.Console.WriteLine("MicroQRVersion:");
// Create an instance of the BarcodeGenerator class and initialize it with the QRcode symbology type and text to be encoded.
using (BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.MicroQR, "EARTH"))
{
// Set the size of QR code in Pixels.
gen.Parameters.Barcode.XDimension.Pixels = 4;
// Save(auto by default) the QR Code image to a specific file in PNG format.
gen.Save($"{path}MicroQRVersionAuto.png", BarCodeImageFormat.Png);
// Set MicroQR M4 version and invoke the Save method to save the output file.
gen.Parameters.Barcode.QR.MicroQRVersion = MicroQRVersion.M4;
gen.Save($"{path}MicroQRVersionM4.png", BarCodeImageFormat.Png);
}
}
}
}

ผลลัพธ์:

micro qr code generator

เช่นเดียวกัน คุณสามารถสร้าง Micro QR Code แบบสี่เหลี่ยมโดยใช้โค้ดตัวอย่างต่อไปนี้:

namespace CSharp.RectMicroQRVersionR11x77
{
class RectMicroQRVersionR11x77
{
static void Main(string[] args)
{
// Define the path to the documents directory.
string path = "/Desktop/";
System.Console.WriteLine("MicroQRVersion:");
using (BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.RectMicroQR, "EARTH"))
{
gen.Parameters.Barcode.XDimension.Pixels = 4;
//auto (by default)
gen.Save($"{path}RectMicroQRVersionAuto.png", BarCodeImageFormat.Png);
//set RectMicroQR R11x77 version
gen.Parameters.Barcode.QR.RectMicroQrVersion = Aspose.BarCode.Generation.RectMicroQRVersion.R11x77;
gen.Save($"{path}RectMicroQRVersionR11x77.png", BarCodeImageFormat.Png);
}
}
}
}

คุณสามารถดู Micro QR Code แบบสี่เหลี่ยมที่สร้างขึ้นในภาพด้านล่าง:

 Rectangular Micro QR code

ฟรี Micro QR Code Generator - เครื่องมือออนไลน์

มี ออนไลน์ Micro QR code scanner และ generator ที่ขับเคลื่อนโดย Aspose.BarCode นอกจากนี้มันยังฟรีและคุณสามารถเปิดมันในเว็บเบราว์เซอร์ที่ใช้กันทั่วไปเกือบทั้งหมด

free micro qr code generator

Micro QR Code Generator - รับใบอนุญาตฟรี

คุณสามารถขอรับ ใบอนุญาตชั่วคราว ฟรีเพื่อทดลองใช้ QR Code SDK นี้โดยไม่มีข้อจำกัดในการประเมินผล

สรุป

นี่คือจุดสิ้นสุดของโพสต์บล็อกนี้ เราได้เรียนรู้วิธีการ สร้าง Micro QR Code ใน C# โดยโปรแกรม นอกจากนี้ เรายังได้เรียนรู้การสร้าง Micro QR Code แบบสี่เหลี่ยม โดยใช้ Aspose.BarCode สำหรับ .NET เช่นเดียวกัน คุณสามารถตรวจสอบ เอกสาร, GitHub repo และ API อ้างอิงเพื่อเรียนรู้เพิ่มเติม

ถามคำถาม

คุณสามารถแจ้งให้เราทราบเกี่ยวกับคำถามหรือข้อสงสัยของคุณใน ฟอรัม

ดูเพิ่มเติม