EasilyNET.Images
1.7.8
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EasilyNET.Images --version 1.7.8
NuGet\Install-Package EasilyNET.Images -Version 1.7.8
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasilyNET.Images" Version="1.7.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasilyNET.Images --version 1.7.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasilyNET.Images, 1.7.8"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EasilyNET.Images as a Cake Addin #addin nuget:?package=EasilyNET.Images&version=1.7.8 // Install EasilyNET.Images as a Cake Tool #tool nuget:?package=EasilyNET.Images&version=1.7.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasilyNET.Images
包含 QRCode 工具,由于绘图等一些操作需要平台依赖包支持,所以会较大,因此单独打包. 简化二维码生成,一般仅需使用 Encode 就够了.
使用 QRCode 功能
- 使用 Nuget GUI 工具添加至项目
- Install-Package EasilyNET.Images
- 若包含中文推荐安装 System.Text.Encoding.CodePages
- 并在程序入口处添加注册代码. Programe.cs
var builder = WebApplication.CreateBuilder(args);
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
QRCode 生成以及解析
- 1.生成二维码.
/// <summary>
/// 生成二维码(默认大小:320*320)
/// </summary>
/// <param name="text">文本内容</param>
/// <param name="keepWhiteBorderPixelVal">白边处理(负值表示不做处理,最大值不超过真实二维码区域的1/10)</param>
/// <param name="width">二维码边长</param>
/// <param name="background">背景色,默认:FFFFFF,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <param name="foreground">前景色,默认:000000,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <returns>Base64字符串</returns>
QrCode.Encode(string text, int keepWhiteBorderPixelVal = -1, int width = 320, string background = "FFF", string foreground = "000")
/// <summary>
/// 生成二维码(320*320)
/// </summary>
/// <param name="text">文本内容</param>
/// <param name="logoImage">Logo图片Base64(缩放到真实二维码区域尺寸的1/6)</param>
/// <param name="keepWhiteBorderPixelVal">白边处理(负值表示不做处理,最大值不超过真实二维码区域的1/10)</param>
/// <param name="width">边长,默认:320px</param>
/// <param name="background">背景色,默认:FFFFFF,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <param name="foreground">前景色,默认:000000,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <returns></returns>
QrCode.Encode(string text, string logoImage, int keepWhiteBorderPixelVal = -1, int width = 320, string background = "FFF", string foreground = "000")
/// <summary>
/// 生成二维码(默认大小:320*320)
/// </summary>
/// <param name="obj">编码对象</param>
/// <param name="keepWhiteBorderPixelVal">白边处理(负值表示不做处理,最大值不超过真实二维码区域的1/10)</param>
/// <param name="width">二维码边长</param>
/// <param name="background">背景色,默认:FFFFFF,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <param name="foreground">前景色,默认:000000,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <returns>Base64字符串</returns>
QrCode.Encode<T>(T obj, int keepWhiteBorderPixelVal = -1, int width = 320, string background = "FFF", string foreground = "000")
/// <summary>
/// 生成二维码(默认大小:320*320)
/// </summary>
/// <param name="obj">编码对象</param>
/// <param name="logoImage">Logo图片Base64(缩放到真实二维码区域尺寸的1/6)</param>
/// <param name="keepWhiteBorderPixelVal">白边处理(负值表示不做处理,最大值不超过真实二维码区域的1/10)</param>
/// <param name="width">二维码边长</param>
/// <param name="background">背景色,默认:FFFFFF,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <param name="foreground">前景色,默认:000000,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <returns>Base64字符串</returns>
QrCode.Encode<T>(T obj, string logoImage, int keepWhiteBorderPixelVal = -1, int width = 320, string background = "FFF", string foreground = "000")
- 2.解析二维码.
/// <summary>
/// 从流中解析二维码数据
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
QrCode.Decode(Stream stream)
/// <summary>
/// 从流中解析二维码数据并转换成对象
/// </summary>
/// <param name="stream"></param>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="JsonException"></exception>
/// <exception cref="NotSupportedException"></exception>
/// <returns></returns>
QrCode.Decode<T>(Stream stream)
/// <summary>
/// 从byte数组中解析二维码
/// </summary>
/// <param name="data"></param>
/// <returns>编码到二维码中的信息</returns>
QrCode.Decode(byte[] data)
/// <summary>
/// 从byte数组中解析二维码数据并转换成对象
/// </summary>
/// <param name="data"></param>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="JsonException"></exception>
/// <exception cref="NotSupportedException"></exception>
/// <returns>编码到二维码中的信息</returns>
QrCode.Decode<T>(byte[] data)
/// <summary>
/// 从Base64解析二维码
/// </summary>
/// <param name="base64"></param>
/// <returns>编码到二维码中的信息</returns>
QrCode.Decode(string base64)
/// <summary>
/// 从二维码解析对象数据
/// </summary>
/// <typeparam name="T">对象实体</typeparam>
/// <param name="base64">Base64字符串</param>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="JsonException"></exception>
/// <exception cref="NotSupportedException"></exception>
/// <returns></returns>
QrCode.Decode<T>(string base64)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 2.88.4-preview.89)
- ZXing.Net (>= 0.16.9)
-
net7.0
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 2.88.4-preview.89)
- ZXing.Net (>= 0.16.9)
-
net8.0
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 2.88.4-preview.89)
- ZXing.Net (>= 0.16.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.24.508.112 | 67 | 5/8/2024 |
2.2024.428.71 | 55 | 4/28/2024 |
2.2024.427.1128 | 55 | 4/27/2024 |
2.2.72 | 74 | 4/14/2024 |
2.2.71 | 56 | 4/12/2024 |
2.2.8 | 54 | 4/26/2024 |
2.2.6 | 58 | 4/10/2024 |
2.2.5 | 68 | 3/26/2024 |
2.2.4 | 72 | 3/25/2024 |
2.2.3 | 60 | 3/24/2024 |
2.2.2 | 69 | 3/21/2024 |
2.2.1 | 65 | 3/20/2024 |
2.2.0 | 75 | 3/13/2024 |
2.1.9 | 75 | 2/21/2024 |
2.1.8 | 57 | 2/18/2024 |
2.1.7 | 82 | 2/16/2024 |
2.1.6 | 82 | 2/14/2024 |
2.1.5 | 65 | 2/14/2024 |
2.1.4 | 86 | 2/9/2024 |
2.1.3 | 113 | 2/8/2024 |
2.1.2 | 117 | 2/5/2024 |
2.1.1.2 | 216 | 12/26/2023 |
2.1.1.1 | 117 | 12/26/2023 |
2.1.1 | 132 | 12/25/2023 |
2.1.0 | 156 | 12/17/2023 |
2.0.11 | 151 | 12/6/2023 |
2.0.1 | 170 | 11/15/2023 |
2.0.0 | 127 | 11/14/2023 |
1.9.1 | 146 | 11/1/2023 |
1.9.0 | 132 | 10/19/2023 |
1.9.0-preview2 | 144 | 10/12/2023 |
1.9.0-preview1 | 112 | 10/12/2023 |
1.8.9 | 120 | 10/11/2023 |
1.8.8 | 127 | 10/11/2023 |
1.8.7-rc2 | 75 | 9/21/2023 |
1.8.7-rc1 | 71 | 9/12/2023 |
1.8.6 | 158 | 8/31/2023 |
1.8.5 | 326 | 8/25/2023 |
1.8.4 | 152 | 8/24/2023 |
1.8.3 | 94 | 8/23/2023 |
1.8.2 | 95 | 8/22/2023 |
1.8.1 | 92 | 8/18/2023 |
1.8.0 | 99 | 8/15/2023 |
1.7.9 | 100 | 8/11/2023 |
1.7.8 | 97 | 8/11/2023 |
1.7.7 | 95 | 8/10/2023 |
1.7.6 | 91 | 8/9/2023 |
1.7.5 | 106 | 8/9/2023 |
1.7.4 | 111 | 8/3/2023 |
1.7.3 | 107 | 8/1/2023 |
1.7.2 | 104 | 7/31/2023 |
1.7.1 | 102 | 7/27/2023 |
1.7.0 | 104 | 7/25/2023 |
1.6.9 | 107 | 7/25/2023 |
1.6.8 | 98 | 7/24/2023 |
1.6.7 | 108 | 7/20/2023 |
1.6.6 | 106 | 7/19/2023 |
1.6.5 | 85 | 7/19/2023 |
1.6.4 | 99 | 7/17/2023 |
1.6.3 | 99 | 7/17/2023 |
1.6.2 | 107 | 7/12/2023 |
1.6.1 | 110 | 6/30/2023 |
1.6.0 | 86 | 6/26/2023 |
1.5.9 | 83 | 6/22/2023 |
1.5.8 | 90 | 6/15/2023 |
1.5.7.1 | 132 | 6/14/2023 |
1.5.7 | 135 | 6/14/2023 |
1.5.6.2 | 152 | 6/7/2023 |
1.5.6.1 | 143 | 6/7/2023 |
1.5.6 | 141 | 6/7/2023 |
1.5.5.2 | 147 | 5/26/2023 |
1.5.5.1 | 164 | 5/26/2023 |
1.5.5 | 147 | 5/26/2023 |
1.5.4.4 | 155 | 5/25/2023 |
1.5.4.3 | 157 | 5/23/2023 |
1.5.4.2 | 169 | 5/17/2023 |
1.5.4.1 | 132 | 5/16/2023 |
1.5.4 | 178 | 5/11/2023 |
1.5.3 | 169 | 5/11/2023 |
1.5.2 | 166 | 5/10/2023 |
1.5.1 | 169 | 5/10/2023 |
1.5.0 | 186 | 5/6/2023 |
1.4.0 | 145 | 5/5/2023 |
1.3.9 | 204 | 4/23/2023 |
1.3.8.6 | 195 | 4/23/2023 |
1.3.8.5 | 184 | 4/21/2023 |
1.3.8.1 | 207 | 4/12/2023 |
1.3.8 | 198 | 4/11/2023 |
1.3.7 | 183 | 4/9/2023 |
1.3.6.3 | 222 | 4/1/2023 |
1.3.6.2 | 192 | 3/31/2023 |
1.3.6.1 | 207 | 3/31/2023 |
1.3.6 | 217 | 3/31/2023 |
1.3.5 | 212 | 3/30/2023 |
1.3.4.1 | 232 | 3/29/2023 |
1.3.4 | 230 | 3/28/2023 |
1.3.3 | 216 | 3/28/2023 |
1.3.2 | 238 | 3/26/2023 |
1.3.1 | 236 | 3/22/2023 |
1.3.0 | 235 | 3/21/2023 |
1.2.0 | 239 | 3/21/2023 |
1.1.0 | 187 | 3/17/2023 |
1.0.9 | 214 | 3/15/2023 |
1.0.8 | 210 | 3/15/2023 |
1.0.7 | 219 | 3/15/2023 |
1.0.6 | 200 | 3/13/2023 |
1.0.5 | 209 | 3/13/2023 |
1.0.4 | 223 | 3/13/2023 |
1.0.0 | 265 | 3/1/2023 |