You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: QrCodeGenerator/QrCodeGenerator.csproj
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,8 @@ Core features:
15
15
- 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.
16
16
- Encodes numeric and special-alphanumeric text in less space than general text
17
17
- Open source code under the permissive MIT License
18
-
- Significantly smaller code but more documentation compared to competing libraries
19
18
- 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
21
20
22
21
Manual parameters:
23
22
- 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.
@@ -99,24 +101,31 @@ QR Code Generator for .NET requires a .NET implementation compatible with .NET S
99
101
100
102
### Raster Images / Bitmaps
101
103
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.
103
105
104
-
In order to use it:
106
+
Two raster bitmap formats are supported with the need for additional libraries:
105
107
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
107
115
- Add the NuGet dependencies to your project
108
116
- Copy the appropriate `QrCodeBitmapExtensions.cs` file to your project
|**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)|
115
124
116
125
Using these extension methods, generating PNG images is straight-forward:
Copy file name to clipboardExpand all lines: QrCodeGenerator/docs/README.md
+28-16Lines changed: 28 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,12 @@ many more programming languages, and the [Project Nayuki web site](https://www.n
13
13
Core features:
14
14
15
15
* 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).
17
17
* Encodes numeric and special-alphanumeric text in less space than general text
18
18
* 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.).
19
20
* 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
21
22
22
23
Manual parameters:
23
24
@@ -28,6 +29,7 @@ Manual parameters:
28
29
29
30
Optional advanced features:
30
31
32
+
* Long text can be split into multiple linked QR codes (aka Structured Append)
31
33
* Encodes Japanese Unicode text in *Kanji mode* to save space compared to UTF-8 bytes
32
34
* Computes *optimal segment mode* switching for text with mixed numeric/alphanumeric/general/kanji parts
33
35
@@ -115,19 +117,25 @@ QR Code Generator for .NET requires a .NET implementation compatible with .NET S
115
117
116
118
### Raster Images / Bitmaps
117
119
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.
119
121
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:
121
129
122
130
- Select one of the imaging libraries below
123
131
- Add the NuGet dependencies to your project
124
132
- Copy the appropriate `QrCodeBitmapExtensions.cs` file to your project
|**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)|
131
139
132
140
Using these extension methods, generating PNG images is straight-forward:
133
141
@@ -149,20 +157,24 @@ namespace Examples
149
157
150
158
## Examples
151
159
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).
153
165
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).
155
167
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).
157
169
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.
159
171
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.
161
173
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.
163
175
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.
165
177
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.
167
179
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).
Copy file name to clipboardExpand all lines: README.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,12 @@ many more programming languages, and the [Project Nayuki web site](https://www.n
13
13
Core features:
14
14
15
15
* 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).
17
17
* Encodes numeric and special-alphanumeric text in less space than general text
18
18
* 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.).
19
20
* 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
21
22
22
23
Manual parameters:
23
24
@@ -28,6 +29,7 @@ Manual parameters:
28
29
29
30
Optional advanced features:
30
31
32
+
* Long text can be split into multiple linked QR codes (aka Structured Append)
31
33
* Encodes Japanese Unicode text in *Kanji mode* to save space compared to UTF-8 bytes
32
34
* Computes *optimal segment mode* switching for text with mixed numeric/alphanumeric/general/kanji parts
33
35
@@ -115,9 +117,15 @@ QR Code Generator for .NET requires a .NET implementation compatible with .NET S
115
117
116
118
### Raster Images / Bitmaps
117
119
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.
119
121
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:
|**System.Drawing**| For Windows only projects |`System.Drawing.Common`|[QrCodeBitmapExtensions.cs](Demo-System-Drawing/QrCodeBitmapExtensions.cs)|
129
137
|**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)|
131
139
132
140
Using these extension methods, generating PNG images is straight-forward:
133
141
@@ -149,7 +157,7 @@ namespace Examples
149
157
150
158
## Examples
151
159
152
-
Several example projects are provided:
160
+
Several example projects demonstrate how to generate QR code with different frameworks and libraries:
153
161
154
162
-[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.
0 commit comments