Resize image files in C# and VB.NET
It's often necessary to resize images to fit the standards of a platform or a document. With GemBox.Imaging, you can resize image files from your C# or VB.NET application.
TThe following example shows how to resize images and save them to various formats programmatically. You will use the image.Resize()
method for this purpose.

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(128, 85);
// Saving the resized image
image.Save("Resized.png");
}
}
}
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(128, 85)
' Saving the resized image
image.Save("Resized.png")
End Using
End Sub
End Module
See also
Next steps
Published: September 14, 2022 | Modified: December 19, 2022 | Author: Ercan Görgülü