Load, edit, and save image files on Linux or macOS
GemBox.Imaging is a standalone .NET component with cross-platform support. This means developers can use it on non-Windows platforms like Linux and macOS.
The following example shows how to load and edit image files using GemBox.Imaging on Linux (Ubuntu). After installing the requirements listed above you can follow these steps using Visual Studio Code (VS Code) to create a simple Console project and a C# code that generates DOCX and PDF files.Prerequisites
1. Open a project folder
2. Create a new console project
dotnet new console
3. Edit project files
<ItemGroup>
<PackageReference Include="GemBox.Imaging" Version="*" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="*" />
</ItemGroup>
using GemBox.Imaging;
class Program
{
static void Main()
{
// If using the Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
using (var image = Image.Load("FragonardReader.jpg"))
{
image.Resize(64, 64);
image.Save("Resized.png");
}
}
}
Imports GemBox.Imaging
Module Program
Sub Main()
' If using the Professional version, put your serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY")
Using image As Image = Image.Load("FragonardReader.jpg")
image.Resize(64, 64)
image.Save("Resized.png")
End Using
End Sub
End Module
4. Run the console project
dotnet run