Installation

安装

本页演示如何向项目中添加 Aspose.Imaging FOSS for .NET 并确认其正确解析。它面向 net8.0 和 netstandard2.0,且没有任何外部运行时依赖。


先决条件

要求细节
Runtime.NET 8.0,或任何 netstandard2.0 兼容的目标
LicenseMIT — 无需密钥
运行时依赖None

添加软件包

git clone https://github.com/aspose-imaging-foss/Aspose.Imaging-FOSS-for-.NET.git
cd Aspose.Imaging-FOSS-for-.NET
dotnet build

命名空间导入

安装后,请在源文件中添加以下 using 指令:

using Aspose.Imaging.Foss;

这个单一命名空间公开了库的完整公共接口:ImageProbe、ImageInfo和ImageFormat。


验证安装

探测一个示例文件并确认包能够正确解析:

using Aspose.Imaging.Foss;

var info = ImageProbe.ProbeFile("photo.jpg");
Console.WriteLine($"{info.Format}: {info.Width}x{info.Height}, {info.BitDepth}-bit");

如果项目能够构建并打印出格式、尺寸和位深,则说明包已正确安装。


后续步骤

另请参阅

 中文