Imaging Library for C# and VB.NET Applications
The fastest way how you can get started with GemBox.Imaging library is by exploring our collection of C# and VB.NET examples. These are live examples that show the supported features and APIs that can be used to achieve various imaging related tasks with the GemBox.Imaging component. GemBox.Imaging requires only .NET, it doesn't have any other dependency. The first step in using the GemBox.Imaging library is to add a reference to GemBox.Imaging.dll in your C# or VB.NET project. There are three ways how to do that. a) Add from NuGet: You can add GemBox.Imaging as a package by using the following command from the NuGet Package Manager Console: Or you can search and add GemBox.Imaging from the NuGet Package Manager. b) Or add from DLL file: You can download GemBox.Imaging.dll file from this page and add a reference by browsing to it. c) Or add from Setup: You can download the GemBox.Imaging Setup from this page. After installing the setup, you can add a reference to GemBox.Imaging.dll from the Global Assembly Cache (GAC). The second step is to add a directive for the GemBox.Imaging namespace. For a C# project, use: The third step is to set the license key to use GemBox.Imaging in one of its working modes. To use a Free mode in a C# project, use: You can read more about GemBox.Imaging's working modes on the Evaluation and Licensing help page. The last step is to write your application-specific imaging code, like the following example code that shows how to load example image, resize it to thumbnail size and then save System Requirements
You can use it on:Hello World
Install-Package GemBox.Imaging
using GemBox.Imaging;
For a VB.NET project, use: Import GemBox.Imaging
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
To use a Free mode in a VB.NET project, use: ComponentInfo.SetLicense("FREE-LIMITED-KEY")
Image
instance to image file.using System;
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("%InputFileName%"))
{
// Resizing the image
image.Resize(64, 64);
// Saving the resized image
image.Save("HelloWorld.%OutputFileType%");
}
}
}
Imports System
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("%InputFileName%")
' Resizing the image
image.Resize(64, 64)
' Saving the resized image
image.Save("HelloWorld.%OutputFileType%")
End Using
End Sub
End Module