CloudYxt.Imager
2.0.0
.NET 6.0
dotnet add package CloudYxt.Imager --version 2.0.0
NuGet\Install-Package CloudYxt.Imager -Version 2.0.0
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="CloudYxt.Imager" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CloudYxt.Imager --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CloudYxt.Imager, 2.0.0"
#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 CloudYxt.Imager as a Cake Addin
#addin nuget:?package=CloudYxt.Imager&version=2.0.0
// Install CloudYxt.Imager as a Cake Tool
#tool nuget:?package=CloudYxt.Imager&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
云享通.Net Core图形图像快捷操作库
从BASE64读取图片
var img = ImageBase64.FromString("data:image/png;base64,iVBORw0KGgoAAAA......");
获取图片格式名称
var format = img.RawFormatName();
Console.WriteLine(format);
重绘图片为静态网页RGB格式
var staticPic = img.ToRGBDraw();
清除图片的EXIF信息
img.ClearExif();
调整大小(可按比例)
/// <param name="w">重绘的宽度值,为0则不处理</param>
/// <param name="h">重绘的高度值,为0则不处理</param>
/// <param name="x">重绘的x定位位置,为0则不处理</param>
/// <param name="y">重绘的y定位位置,为0则不处理</param>
img.ToResize(w, h, x, y);
加水印(可按比例)
/// <param name="img_water">水印图</param>
/// <param name="x">水印距离原始图的x坐标位置,若为负数则从右向左计算</param>
/// <param name="y">水印距离原始图的y坐标位置,若为负数则从下向上计算</param>
/// <param name="mult">相对原始图的图片倍数,以宽计算,默认为0.28</param>
img.ToWater(img_water, x, y, mult);
将图片保存为字节数组
//同步方法
img.SaveToByte(new JpegEncoder()
{
Quality = 100,
SkipMetadata = true,
});
//异步方法
await img.SaveToByteAsync(new JpegEncoder()
{
Quality = 100,
SkipMetadata = true,
});
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 was computed. 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. |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- SixLabors.ImageSharp (>= 3.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
云享通.Net Core图形图像快捷操作库。
2.0.0:
调整依赖包为SixLabors.ImageSharp,以支持跨平台图像处理,调整方法名以适配新的依赖包
1.0.0:
图片调整大小ResizeTo、图片打水印WaterTo
快捷格式存储ToJPGByte、ToPNGByte
从字节数组创建图片FromByte、从BASE64文本创建图片FromBase64