Skip to content

Commit d75ad20

Browse files
committed
Update documentation
1 parent ce0fad9 commit d75ad20

5 files changed

Lines changed: 74 additions & 45 deletions

File tree

QrCodeGenerator/QrCodeGenerator.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ Core features:
1515
- Output formats: Raw modules/pixels of the QR symbol, SVG, XAML path, PNG and BMP files. For other raster bitmap formats, see project home page.
1616
- Encodes numeric and special-alphanumeric text in less space than general text
1717
- Open source code under the permissive MIT License
18-
- Significantly smaller code but more documentation compared to competing libraries
1918
- Built for .NET Standard 2.0 and therefore runs on most modern .NET platforms (.NET Core, .NET Framework, Mono etc.).
20-
- Derived from tried and tested implementation by project Nayuki
19+
- Example code for WinForms, WPF, ASP.NET, ImageSharp, SkiaSharp and many more
2120

2221
Manual parameters:
2322
- You can specify the minimum and maximum version number allowed, and the library will automatically choose the smallest version in the range that fits the data.

QrCodeGenerator/docfx/api/index.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ Additional information on [GitHub project page](https://github.com/manuelbl/QrCo
2121
Core features:
2222

2323
* Supports encoding all 40 versions (sizes) and all 4 error correction levels, as per the QR Code Model 2 standard
24-
* Output formats: Raw modules/pixels of the QR symbol and SVG XML string
24+
* Output formats: Raw modules/pixels of the QR symbol, SVG, XAML path, PNG and BMP files. For other raster bitmap formats, see project home page.
2525
* Encodes numeric and special alphanumeric text in less space than general text
2626
* Open source code under the permissive *MIT License*
27-
* Significantly shorter code but more documentation compared to competing libraries
27+
* Built for .NET Standard 2.0 and therefore runs on most modern .NET platforms (.NET Core, .NET Framework, Mono etc.).
2828
* Available as a [NuGet package](https://www.nuget.org/packages/Net.Codecrete.QrCodeGenerator/) (named *Net.Codecrete.QrCodeGenerator*)
29+
* Example code for WinForms, WPF, ASP.NET, ImageSharp, SkiaSharp and many more
2930

3031
Manual parameters:
3132

@@ -36,6 +37,7 @@ Manual parameters:
3637

3738
Optional advanced features:
3839

40+
* Long text can be split into multiple linked QR codes (aka Structured Append)
3941
* Encodes Japanese Unicode text in *Kanji mode* to save a lot of space compared to UTF-8 bytes
4042
* Computes *optimal segment mode* switching for text with mixed numeric/alphanumeric/general/kanji parts
4143

@@ -44,8 +46,8 @@ Optional advanced features:
4446

4547
Simple operation:
4648

47-
```cslang
48-
using Net.Codecrete.QrCodeGenerator;
49+
<pre>
50+
<code class="lang-csharp hljs">using Net.Codecrete.QrCodeGenerator;
4951

5052
namespace Examples
5153
{
@@ -58,13 +60,13 @@ namespace Examples
5860
File.WriteAllText("hello-world-qr.svg", svg, Encoding.UTF8);
5961
}
6062
}
61-
}
62-
```
63+
}</code>
64+
</pre>
6365

6466
Manual operation:
6567

66-
```cslang
67-
using Net.Codecrete.QrCodeGenerator;
68+
<pre>
69+
<code class="lang-csharp hljs">using Net.Codecrete.QrCodeGenerator;
6870

6971
namespace Examples
7072
{
@@ -83,8 +85,8 @@ namespace Examples
8385
}
8486
}
8587
}
86-
}
87-
```
88+
}</code>
89+
</pre>
8890

8991

9092
## Requirements
@@ -99,24 +101,31 @@ QR Code Generator for .NET requires a .NET implementation compatible with .NET S
99101

100102
### Raster Images / Bitmaps
101103

102-
The previous version of this library depended on *System.Drawing*, which - starting with .NET 6 - will only be supported on Windows operation system. Therefore, `ToBitmap()` has been removed and three options are now offered in the form of method extensions.
104+
Starting with .NET 6, *System.Drawing* is only supported on Windows operating system and thus cannot be used for multi-platform libraries like this one. Therefore, `ToBitmap()` has been removed.
103105

104-
In order to use it:
106+
Two raster bitmap formats are supported with the need for additional libraries:
105107

106-
- Select one of the libraries
108+
- *PNG*: See [`QrCode.ToPngBitmap()`](xref:Net.Codecrete.QrCodeGenerator.QrCode.ToPngBitmap(System.Int32,System.Int32))
109+
- *BMP*: See [`QrCode.ToBmpBitmap()`](xref:Net.Codecrete.QrCodeGenerator.QrCode.ToBmpBitmap(System.Int32,System.Int32))
110+
111+
These methods are limited, e.g. with regards to the size of the generated image.
112+
For more advanced and more efficient ways to generate different raster image formats:
113+
114+
- Select one of the imaging libraries below
107115
- Add the NuGet dependencies to your project
108116
- Copy the appropriate `QrCodeBitmapExtensions.cs` file to your project
109117

118+
110119
| Library | Recommendation | NuGet dependencies | Extension file |
111120
| ------- | -------------- | ------------------ | -------------- |
112-
| **System.Drawing** | For Windows only projects | `System.Drawing.Common` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
113-
| **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/Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
114-
| **ImageSharp** | Currently in beta state | `SixLabors.ImageSharp.Drawing` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/Demo-ImageSharp/QrCodeBitmapExtensions.cs) |
121+
| **System.Drawing** | For Windows only projects | `System.Drawing.Common` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
122+
| **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) |
123+
| **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) |
115124

116125
Using these extension methods, generating PNG images is straight-forward:
117126

118-
```cslang
119-
using Net.Codecrete.QrCodeGenerator;
127+
<pre>
128+
<code class="lang-csharp hljs">using Net.Codecrete.QrCodeGenerator;
120129

121130
namespace Examples
122131
{
@@ -128,5 +137,5 @@ namespace Examples
128137
qr.SaveAsPng("hello-world-qr.png", 10, 3);
129138
}
130139
}
131-
}
132-
```
140+
}</code>
141+
</pre>

QrCodeGenerator/docfx/docfx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"globalMetadataFiles": [],
4747
"fileMetadataFiles": [],
4848
"template": [
49-
"default"
49+
"default",
50+
"modern"
5051
],
5152
"postProcessors": [],
5253
"markdownEngineName": "markdig",

QrCodeGenerator/docs/README.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ many more programming languages, and the [Project Nayuki web site](https://www.n
1313
Core features:
1414

1515
* Supports encoding all 40 versions (sizes) and all 4 error correction levels, as per the QR Code Model 2 standard
16-
* Output formats: Raw modules/pixels of the QR symbol, SVG and XAML path. For raster bitmaps, additional code is provided. See [below](#raster-images--bitmaps).
16+
* Output formats: Raw modules/pixels of the QR symbol, SVG, XAML path, PNG and BMP files. For other raster bitmap formats, see [below](#raster-images--bitmaps).
1717
* Encodes numeric and special-alphanumeric text in less space than general text
1818
* Open source code under the permissive *MIT License*
19+
* Built for .NET Standard 2.0 and therefore runs on most modern .NET platforms (.NET Core, .NET Framework, Mono etc.).
1920
* Available as a [NuGet package](https://www.nuget.org/packages/Net.Codecrete.QrCodeGenerator/) (named *Net.Codecrete.QrCodeGenerator*)
20-
* Example code for WinForms, WPF, ASP.NET, ImageSharp, SkiaSharp etc.
21+
* Example code for WinForms, WPF, ASP.NET, ImageSharp, SkiaSharp and many more
2122

2223
Manual parameters:
2324

@@ -28,6 +29,7 @@ Manual parameters:
2829

2930
Optional advanced features:
3031

32+
* Long text can be split into multiple linked QR codes (aka Structured Append)
3133
* Encodes Japanese Unicode text in *Kanji mode* to save space compared to UTF-8 bytes
3234
* Computes *optimal segment mode* switching for text with mixed numeric/alphanumeric/general/kanji parts
3335

@@ -115,19 +117,25 @@ QR Code Generator for .NET requires a .NET implementation compatible with .NET S
115117

116118
### Raster Images / Bitmaps
117119

118-
Starting with .NET 6, *System.Drawing* is only supported on Windows operating system and thus cannot be used for multi-platform libraries like this one. Therefore, `ToBitmap()` has been removed and three options are now offered in the form of method extensions.
120+
Starting with .NET 6, *System.Drawing* is only supported on Windows operating system and thus cannot be used for multi-platform libraries like this one. Therefore, `ToBitmap()` has been removed.
119121

120-
To use it:
122+
Two raster bitmap formats are supported with the need for additional libraries:
123+
124+
- *PNG*: See `QrCode.ToPngBitmap()`
125+
- *BMP*: See `QrCode.ToBmpBitmap()`
126+
127+
These methods are limited, e.g. with regards to the size of the generated image.
128+
For more advanced and more efficient ways to generate different raster image formats:
121129

122130
- Select one of the imaging libraries below
123131
- Add the NuGet dependencies to your project
124132
- Copy the appropriate `QrCodeBitmapExtensions.cs` file to your project
125133

126134
| Imaging library | Recommendation | NuGet dependencies | Extension file |
127135
| ------- | -------------- | ------------------ | -------------- |
128-
| **System.Drawing** | For Windows only projects | `System.Drawing.Common` | [QrCodeBitmapExtensions.cs](Demo-System-Drawing/QrCodeBitmapExtensions.cs) |
129-
| **SkiaSharp** | For macOS, Linux, iOS, Android and multi-platform projects | `SkiaSharp` and `SkiaSharp.NativeAssets.Linux` (for Linux only) | [QrCodeBitmapExtensions.cs](Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
130-
| **ImageSharp** | Currently in beta state | `SixLabors.ImageSharp.Drawing` | [QrCodeBitmapExtensions.cs](Demo-ImageSharp/QrCodeBitmapExtensions.cs) |
136+
| **System.Drawing** | For Windows only projects | `System.Drawing.Common` | [QrCodeBitmapExtensions.cs](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-System-Drawing/QrCodeBitmapExtensions.cs) |
137+
| **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) |
138+
| **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/Demo-ImageSharp/QrCodeBitmapExtensions.cs) |
131139

132140
Using these extension methods, generating PNG images is straight-forward:
133141

@@ -149,20 +157,24 @@ namespace Examples
149157

150158
## Examples
151159

152-
Several example projects are provided:
160+
Several example projects demonstrate how to generate QR code with different frameworks and libraries:
161+
162+
- [Demo-QRCode-Variety](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-QRCode-Variety): Demonstrates how QR codes with different encodings, error correction and masks can be generated. All QR codes are saved as SVG files.
163+
164+
- [Demo-WinUI](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-WinUI): Demonstrates how QR codes can be used in WinUI 3 applications and/or using [Win2D](https://github.com/microsoft/Win2D) (incl. copying to the clipboard).
153165

154-
- [Demo-QRCode-Variety](Demo-QRCode-Variety): Demonstrates how QR codes with different encodings, error correction and masks can be generated. All QR codes are saved as SVG files.
166+
- [Demo-WindowsPresentationFoundation](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-WindowsPresentationFoundation): Demonstrates how QR codes can be used in WPF applications (incl. copying to the clipboard).
155167

156-
- [Demo-WindowsPresentationFoundation](Demo-WindowsPresentationFoundation): Demonstrates how QR codes can be used in WPF applications (incl. copying to the clipboard).
168+
- [Demo-WinForms](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-WinForms): Demonstrates how QR codes can be used in Windows Forms applications (incl. copying to the clipboard).
157169

158-
- [Demo-WinForms](Demo-WinForms): Demonstrates how QR codes can be used in Windows Forms applications (incl. copying to the clipboard).
170+
- [Demo-ASP.NET-Core](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-ASP.NET-Core): Demonstrates how to create QR codes in a web application implemented using ASP.NET Core.
159171

160-
- [Demo-ASP.NET-Core](Demo-ASP.NET-Core): Demonstrates how to create QR codes in a web application implemented using ASP.NET Core.
172+
- [Demo-VCard](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-VCard): Demonstrates how contact data (similar to business cards) can be saved in a QR Code using the VCard standard.
161173

162-
- [Demo-VCard](Demo-VCard): Demonstrates how contact data (similar to business cards) can be saved in a QR Code using the VCard standard.
174+
- [Demo-System-Drawing](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-System-Drawing): Demonstrates how a QR code can be saved a PNG file, using the *System.Drawing* classes, which have become a Windows only technology starting with .NET 6.
163175

164-
- [Demo-System-Drawing](Demo-System-Drawing): Demonstrates how a QR code can be saved a PNG file, using the *System.Drawing* classes, which have become a Windows only technology starting with .NET 6.
176+
- [Demo-SkiaSharp](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-SkiaSharp): Demonstrates how a QR code can be saved a PNG file, using the SkiaSharp multi-platform raster image library.
165177

166-
- [Demo-SkiaSharp](Demo-SkiaSharp): Demonstrates how a QR code can be saved a PNG file, using the SkiaSharp multi-platform raster image library.
178+
- [Demo-ImageSharp](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-ImageSharp): Demonstrates how a QR code can be saved a PNG file, using the ImageSharp raster image library. Additionally, a QR code with an image in the center is created.
167179

168-
- [Demo-ImageSharp](Demo-ImageSharp): Demonstrates how a QR code can be saved a PNG file, using the ImageSharp raster image library. Additionally, a QR code with an image in the center is created.
180+
- [Demo-ImageMagick](https://github.com/manuelbl/QrCodeGenerator/blob/v2.1.0/Demo-ImageMagick): Demonstrates how a QR code can be saved a PNG file, using the Magick.NET image manipulation library (based on ImageMagick).

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ many more programming languages, and the [Project Nayuki web site](https://www.n
1313
Core features:
1414

1515
* Supports encoding all 40 versions (sizes) and all 4 error correction levels, as per the QR Code Model 2 standard
16-
* Output formats: Raw modules/pixels of the QR symbol, SVG and XAML path, BMP bitmap. For raster bitmap output, additional code is provided. See [below](#raster-images--bitmaps).
16+
* Output formats: Raw modules/pixels of the QR symbol, SVG, XAML path, PNG and BMP files. For other raster bitmap formats, see [below](#raster-images--bitmaps).
1717
* Encodes numeric and special-alphanumeric text in less space than general text
1818
* Open source code under the permissive *MIT License*
19+
* Built for .NET Standard 2.0 and therefore runs on most modern .NET platforms (.NET Core, .NET Framework, Mono etc.).
1920
* Available as a [NuGet package](https://www.nuget.org/packages/Net.Codecrete.QrCodeGenerator/) (named *Net.Codecrete.QrCodeGenerator*)
20-
* Example code for WinForms, WPF, ASP.NET, ImageSharp, SkiaSharp etc.
21+
* Example code for WinForms, WPF, ASP.NET, ImageSharp, SkiaSharp and many more
2122

2223
Manual parameters:
2324

@@ -28,6 +29,7 @@ Manual parameters:
2829

2930
Optional advanced features:
3031

32+
* Long text can be split into multiple linked QR codes (aka Structured Append)
3133
* Encodes Japanese Unicode text in *Kanji mode* to save space compared to UTF-8 bytes
3234
* Computes *optimal segment mode* switching for text with mixed numeric/alphanumeric/general/kanji parts
3335

@@ -115,9 +117,15 @@ QR Code Generator for .NET requires a .NET implementation compatible with .NET S
115117

116118
### Raster Images / Bitmaps
117119

118-
Starting with .NET 6, *System.Drawing* is only supported on Windows operating system and thus cannot be used for multi-platform libraries like this one. Therefore, `ToBitmap()` has been removed and three options are now offered in the form of method extensions.
120+
Starting with .NET 6, *System.Drawing* is only supported on Windows operating system and thus cannot be used for multi-platform libraries like this one. Therefore, `ToBitmap()` has been removed.
119121

120-
To use it:
122+
Two raster bitmap formats are supported with the need for additional libraries:
123+
124+
- *PNG*: See `QrCode.ToPngBitmap()`
125+
- *BMP*: See `QrCode.ToBmpBitmap()`
126+
127+
These methods are limited, e.g. with regards to the size of the generated image.
128+
For more advanced and more efficient ways to generate different raster image formats:
121129

122130
- Select one of the imaging libraries below
123131
- Add the NuGet dependencies to your project
@@ -127,7 +135,7 @@ To use it:
127135
| ------- | -------------- | ------------------ | -------------- |
128136
| **System.Drawing** | For Windows only projects | `System.Drawing.Common` | [QrCodeBitmapExtensions.cs](Demo-System-Drawing/QrCodeBitmapExtensions.cs) |
129137
| **SkiaSharp** | For macOS, Linux, iOS, Android and multi-platform projects | `SkiaSharp` and `SkiaSharp.NativeAssets.Linux` (for Linux only) | [QrCodeBitmapExtensions.cs](Demo-SkiaSharp/QrCodeBitmapExtensions.cs) |
130-
| **ImageSharp** | Currently in beta state | `SixLabors.ImageSharp.Drawing` | [QrCodeBitmapExtensions.cs](Demo-ImageSharp/QrCodeBitmapExtensions.cs) |
138+
| **ImageSharp** | Alternative for multi-platform projects. Might require a commercial license. | `SixLabors.ImageSharp.Drawing` | [QrCodeBitmapExtensions.cs](Demo-ImageSharp/QrCodeBitmapExtensions.cs) |
131139

132140
Using these extension methods, generating PNG images is straight-forward:
133141

@@ -149,7 +157,7 @@ namespace Examples
149157

150158
## Examples
151159

152-
Several example projects are provided:
160+
Several example projects demonstrate how to generate QR code with different frameworks and libraries:
153161

154162
- [Demo-QRCode-Variety](Demo-QRCode-Variety): Demonstrates how QR codes with different encodings, error correction and masks can be generated. All QR codes are saved as SVG files.
155163

0 commit comments

Comments
 (0)