Skip to content

Commit d76dd98

Browse files
committed
Rename examples
1 parent ca880ce commit d76dd98

14 files changed

Lines changed: 348 additions & 338 deletions

File tree

.github/workflows/demos.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
$pkg = Resolve-Path QrCodeGenerator\bin\Release\Net.Codecrete.QrCodeGenerator.*.nupkg
4444
nuget push $pkg -Source Local
4545
46+
- name: Build Basic-Example
47+
run: dotnet build
48+
working-directory: Basic-Example
4649
- name: Build Demo-ImageSharp
4750
run: dotnet build
4851
working-directory: Demo-ImageSharp
@@ -52,9 +55,6 @@ jobs:
5255
- name: Build Demo-ImageMagick
5356
run: dotnet build
5457
working-directory: Demo-ImageMagick
55-
- name: Build Demo-QRCode-Variety
56-
run: dotnet build
57-
working-directory: Demo-QRCode-Variety
5858
- name: Build Demo-SkiaSharp
5959
run: dotnet build
6060
working-directory: Demo-SkiaSharp

Demo-QRCode-Variety/Demo-QRCode-Variety.csproj renamed to Basic-Example/Basic-Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
6-
<RootNamespace>Demo_Basic</RootNamespace>
6+
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
</PropertyGroup>
88

99
<ItemGroup>

Demo-QRCode-Variety/Demo-QRCode-Variety.sln renamed to Basic-Example/Basic-Example.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo-QRCode-Variety", "Demo-QRCode-Variety.csproj", "{CE334406-7A4A-4455-889B-200DEBB6C08C}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Basic-Example", "Basic-Example.csproj", "{CE334406-7A4A-4455-889B-200DEBB6C08C}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
1-
/*
1+
/*
22
* QR code generator library (.NET)
33
*
44
* Copyright (c) Manuel Bleichenbacher (MIT License)
55
* https://github.com/manuelbl/QrCodeGenerator
6-
* Copyright (c) Project Nayuki (MIT License)
7-
* https://www.nayuki.io/page/qr-code-generator-library
8-
*
9-
* Permission is hereby granted, free of charge, to any person obtaining a copy
10-
* of this software and associated documentation files (the "Software"), to deal
11-
* in the Software without restriction, including without limitation the rights
12-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13-
* copies of the Software, and to permit persons to whom the Software is
14-
* furnished to do so, subject to the following conditions:
15-
*
16-
* The above copyright notice and this permission notice shall be included in
17-
* all copies or substantial portions of the Software.
18-
*
19-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25-
* IN THE SOFTWARE.
266
*/
277

288
using System.IO;
@@ -41,7 +21,6 @@ internal static void Main()
4121
BasicQrCode();
4222
AlphanumericText();
4323
LongerText();
44-
KanjiText();
4524
Emojis();
4625
EmojisWithoutEci();
4726
BinaryData();
@@ -69,7 +48,7 @@ private static void AlphanumericText()
6948

7049
// For an alphanumeric subset of characters (not including lower-case letters),
7150
// a more compact representation will be automatically chosen (5.5 bits per character)
72-
qrCode = QrCode.EncodeText("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG $ * 0123456789", QrCode.Ecc.High);
51+
qrCode = QrCode.EncodeText("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG", QrCode.Ecc.High);
7352
SaveAsSvg(qrCode, "alphanumeric-qr.svg");
7453
}
7554

@@ -85,14 +64,7 @@ private static void LongerText()
8564
"I will Yes.", QrCode.Ecc.High);
8665
SaveAsSvg(qrCode, "joyce-qr.svg");
8766
}
88-
89-
private static void KanjiText()
90-
{
91-
// Select Shift-JIS encoding so Kanji characters are compactly encoded (13 bits per character)
92-
var qrCode = QrCode.EncodeTextAdvanced("こんにちは", QrCode.Ecc.Medium, eci: ECI.ShiftJIS);
93-
SaveAsSvg(qrCode, "kanji-qr.svg");
94-
}
95-
67+
9668
private static void Emojis()
9769
{
9870
// The full Unicode character set is supported.

Basic-Example/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Example code for generating QR codes
2+
3+
This example program creates a series of QR code and saves them as SVG, PNG and BMP files.
4+
It is a simple console application without the need for any further libraries.
5+
It will run on any .NET platform compatible with .NET Standard 2.0.
6+
7+
The examples demonstrate the use of:
8+
9+
- different texxt encoding (short/long, digits, alphanumeric, full Unicode)
10+
- different error correction levels
11+
- encoding binary data

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dotnet pack --no-build
4242
- **`QrCodeGeneratorProfiling/`** targets `net10.0` (BenchmarkDotNet).
4343
- **`QrCodeAnalyzer/`** is a separate WPF tool in its own solution (`QrCodeAnalyzer/QrCodeAnalyzer.sln`), not part of `QrCodeGenerator.sln`.
4444

45-
Version 3 is a complete rewrite (≈10x faster, more standard-compliant) of what began as a port of Project Nayuki's Java library. The previous public type `QrSegment` is now `DataSegment`.
45+
Version 3 is a complete rewrite (≈10x faster, more standard-compliant) of what began as a port of Project Nayuki's Java library.
4646

4747
## Architecture
4848

Demo-QRCode-Variety/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

Demo-SkiaSharp/Demo-SkiaSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
8-
<Version>2.1.0</Version>
8+
<Version>3.0.0</Version>
99
<Authors>Manuel Bleichenbacher</Authors>
1010
<Product>QR Code Generator for .NET</Product>
1111
<Description>Demo application for QR Code Generation</Description>

Demo-System-Drawing/Demo-System-Drawing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework>net8.0</TargetFramework>
66
<RootNamespace>Net.Codecrete.QrCodeGenerator.Demo</RootNamespace>
77
<PackageId>Net.Codecrete.QrCodeGenerator.Demo</PackageId>
8-
<Version>2.1.0</Version>
8+
<Version>3.0.0</Version>
99
<Authors>Manuel Bleichenbacher</Authors>
1010
<Product>QR Code Generator for .NET</Product>
1111
<Description>Demo application for QR Code Generation</Description>

QrCodeGenerator/docfx/api/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ For more advanced and more efficient ways to generate different raster image for
110110

111111
| Library | Recommendation | NuGet dependencies | Extension file |
112112
| ------- | -------------- | ------------------ | -------------- |
113-
| **System.Drawing** | For Windows only projects | `System.Drawing.Common` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
114-
| **SkiaSharp** | For macOS, Linux, iOS, Android and multi-platform projects | `SkiaSharp` and `SkiaSharp.NativeAssets.Linux` (for Linux only) | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
115-
| **ImageSharp** | Alternative for multi-platform projects. Might require a commercial license. | `SixLabors.ImageSharp.Drawing` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/QrCodeBitmapExtensions.cs) |
113+
| **System.Drawing** | For Windows only projects | `System.Drawing.Common` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v3.0.0/Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
114+
| **SkiaSharp** | For macOS, Linux, iOS, Android and multi-platform projects | `SkiaSharp` and `SkiaSharp.NativeAssets.Linux` (for Linux only) | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v3.0.0/Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
115+
| **ImageSharp** | Alternative for multi-platform projects. Might require a commercial license. | `SixLabors.ImageSharp.Drawing` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v3.0.0/QrCodeBitmapExtensions.cs) |
116116

117117
Using these extension methods, generating PNG images is straight-forward:
118118

0 commit comments

Comments
 (0)