EasilyNET.Images 1.3.4.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasilyNET.Images --version 1.3.4.1                
NuGet\Install-Package EasilyNET.Images -Version 1.3.4.1                
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.3.4.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasilyNET.Images --version 1.3.4.1                
#r "nuget: EasilyNET.Images, 1.3.4.1"                
#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.3.4.1

// Install EasilyNET.Images as a Cake Tool
#tool nuget:?package=EasilyNET.Images&version=1.3.4.1                
EasilyNET.Images

包含 QRCode 工具,由于绘图等一些操作需要平台依赖包支持,所以会较大,因此单独打包. 简化二维码生成,仅 5 个 API,一般仅需使用 GetBase64 就够了.

使用 QRCode 功能
  • 使用 Nuget GUI 工具添加至项目
  • Install-Package EasilyNET.Images
  • 若是遇到 System.ArgumentException: 'shift_jis' is not a supported encoding name. 的错误需要进行如下操作.
  • 这是由于遇到了不支持的字符集的问题.
  • 在主项目中添加 System.Text.Encoding.CodePages 库,并在程序入口处添加注册代码. Programe.cs
var builder = WebApplication.CreateBuilder(args);

System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
QRCode 生成以及解析
  • 1.GetBase64 方法.
/// <summary>
/// 生成二维码(默认大小:320*320)
/// </summary>
/// <param name="text">文本内容</param>
/// <param name="keepWhiteBorderPixelVal">白边处理(负值表示不做处理,最大值不超过真实二维码区域的1/10)</param>
/// <param name="width">二维码边长</param>
/// <param name="format">生成格式,默认:PNG</param>
/// <param name="background">背景色,默认:FFFFFF,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <param name="foreground">前景色,默认:000000,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
public static string GetBase64(string text, int keepWhiteBorderPixelVal = -1, int width = 320, SKEncodedImageFormat format = SKEncodedImageFormat.Png, string background = "FFF", string foreground = "000")
  • 2.获取图片的二进制数组.
/// <summary>
/// 生成二维码(320*320)
/// </summary>
/// <param name="text">文本内容</param>
/// <param name="logoImage">Logo图片(缩放到真实二维码区域尺寸的1/6)</param>
/// <param name="keepWhiteBorderPixelVal">白边处理(负值表示不做处理,最大值不超过真实二维码区域的1/10)</param>
/// <param name="width">边长,默认:320px</param>
/// <param name="format">生成格式,默认:PNG</param>
/// <param name="background">背景色,默认:FFFFFF,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <param name="foreground">前景色,默认:000000,16进制色值编码,不带'#'编码格式: AARRGGB, RRGGBB, ARGB, RGB.</param>
/// <returns></returns>
public static byte[] QrCoder(string text, byte[]? logoImage = null, int keepWhiteBorderPixelVal = -1, int width = 320, SKEncodedImageFormat format = SKEncodedImageFormat.Png, string background = "FFF", string foreground = "000")
  • 3.传入二维码的 base64 字符串,解析二维码.
/// <summary>
/// 从Base64解析二维码
/// </summary>
/// <param name="base64"></param>
/// <returns></returns>
public static string QrDecoder(string base64)
  • 4.通过 byte 数组解析二维码
/// <summary>
/// 从byte数组中解析二维码
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static string QrDecoder(string base64)
  • 5.从流中解析二维码
/// <summary>
/// 从流中解析二维码
/// </summary>
/// <param name="stream"></param>
/// <returns></returns>
public static string QrDecoder(Stream stream)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 77 5/8/2024
2.2024.428.71 61 4/28/2024
2.2024.427.1128 59 4/27/2024
2.2.72 84 4/14/2024
2.2.71 62 4/12/2024
2.2.8 58 4/26/2024
2.2.6 67 4/10/2024
2.2.5 74 3/26/2024
2.2.4 78 3/25/2024
2.2.3 66 3/24/2024
2.2.2 73 3/21/2024
2.2.1 73 3/20/2024
2.2.0 79 3/13/2024
2.1.9 79 2/21/2024
2.1.8 67 2/18/2024
2.1.7 86 2/16/2024
2.1.6 88 2/14/2024
2.1.5 68 2/14/2024
2.1.4 91 2/9/2024
2.1.3 117 2/8/2024
2.1.2 125 2/5/2024
2.1.1.2 218 12/26/2023
2.1.1.1 125 12/26/2023
2.1.1 133 12/25/2023
2.1.0 162 12/17/2023
2.0.11 153 12/6/2023
2.0.1 174 11/15/2023
2.0.0 136 11/14/2023
1.9.1 150 11/1/2023
1.9.0 135 10/19/2023
1.9.0-preview2 151 10/12/2023
1.9.0-preview1 114 10/12/2023
1.8.9 122 10/11/2023
1.8.8 135 10/11/2023
1.8.7-rc2 81 9/21/2023
1.8.7-rc1 76 9/12/2023
1.8.6 161 8/31/2023
1.8.5 340 8/25/2023
1.8.4 156 8/24/2023
1.8.3 101 8/23/2023
1.8.2 105 8/22/2023
1.8.1 103 8/18/2023
1.8.0 104 8/15/2023
1.7.9 113 8/11/2023
1.7.8 102 8/11/2023
1.7.7 103 8/10/2023
1.7.6 98 8/9/2023
1.7.5 111 8/9/2023
1.7.4 121 8/3/2023
1.7.3 112 8/1/2023
1.7.2 109 7/31/2023
1.7.1 107 7/27/2023
1.7.0 113 7/25/2023
1.6.9 112 7/25/2023
1.6.8 109 7/24/2023
1.6.7 113 7/20/2023
1.6.6 111 7/19/2023
1.6.5 98 7/19/2023
1.6.4 106 7/17/2023
1.6.3 107 7/17/2023
1.6.2 114 7/12/2023
1.6.1 115 6/30/2023
1.6.0 91 6/26/2023
1.5.9 96 6/22/2023
1.5.8 95 6/15/2023
1.5.7.1 135 6/14/2023
1.5.7 138 6/14/2023
1.5.6.2 154 6/7/2023
1.5.6.1 147 6/7/2023
1.5.6 144 6/7/2023
1.5.5.2 148 5/26/2023
1.5.5.1 166 5/26/2023
1.5.5 151 5/26/2023
1.5.4.4 159 5/25/2023
1.5.4.3 161 5/23/2023
1.5.4.2 171 5/17/2023
1.5.4.1 134 5/16/2023
1.5.4 180 5/11/2023
1.5.3 178 5/11/2023
1.5.2 168 5/10/2023
1.5.1 179 5/10/2023
1.5.0 188 5/6/2023
1.4.0 155 5/5/2023
1.3.9 206 4/23/2023
1.3.8.6 197 4/23/2023
1.3.8.5 191 4/21/2023
1.3.8.1 210 4/12/2023
1.3.8 200 4/11/2023
1.3.7 187 4/9/2023
1.3.6.3 230 4/1/2023
1.3.6.2 196 3/31/2023
1.3.6.1 215 3/31/2023
1.3.6 219 3/31/2023
1.3.5 214 3/30/2023
1.3.4.1 236 3/29/2023
1.3.4 234 3/28/2023
1.3.3 225 3/28/2023
1.3.2 240 3/26/2023
1.3.1 238 3/22/2023
1.3.0 237 3/21/2023
1.2.0 241 3/21/2023
1.1.0 189 3/17/2023
1.0.9 216 3/15/2023
1.0.8 212 3/15/2023
1.0.7 220 3/15/2023
1.0.6 204 3/13/2023
1.0.5 217 3/13/2023
1.0.4 225 3/13/2023
1.0.0 267 3/1/2023