forked from manuelbl/QrCodeGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
29 lines (25 loc) · 772 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// QR code generator library (.NET)
// https://github.com/manuelbl/QrCodeGenerator
//
// Copyright (c) 2021 Manuel Bleichenbacher
// Licensed under MIT License
// https://opensource.org/licenses/MIT
//
using System;
using System.IO;
namespace Net.Codecrete.QrCodeGenerator.Demo
{
internal class Program
{
// Create a QR code and save it as a PNG.
internal static void Main()
{
var text = "Hello, world!";
var filename = "hello-world-QR.png";
var qr = QrCode.EncodeText(text, QrCode.Ecc.Medium); // Create the QR code symbol
qr.SaveAsPng(filename, scale: 10, border: 4);
Console.WriteLine($"The QR code has been saved as {Path.GetFullPath(filename)}");
}
}
}