Guide for C#
Core Document Formats
Additional Features
Image Resizing

C# Imaging - Resize Image in C#.NET

C#.NET Image Resizer Control SDK to Adjust Image Size

Visual C#
Home > .NET Imaging SDK > C# > Resize Image
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

RasterEdge C#.NET image resizer library control SDK is a 100% clean .NET solution, which is designed to help C# developers resize target image file to desired settings. Using this Visual C# .NET image resizing control, developers can adjust, enlarge or shrink the size of source image file either vertically or horizontally by a few lines of simple C# code.
Apart from this C# image resizing control, RasterEdge DocImage SDK for .NET (a professional third-party imaging SDK from RasterEdge) also contains other image processing and manipulating controls, like C#.NET image cropping control, C#.NET image rotating control and image flipping library control.
This online tutorial contains both theoretical guidance and sample C# code for developers to resize source image in .NET applications. And this is the article layout of this RasterEdge C#.NET image resize control guide page.
  • Feature list of C#.NET image resizer library control SDK
  • How to resize image using RasterEdge image resizing SDK in C#.NET class application
  • C#.NET method to resize image
  • C# demo code to adjust the size of source image
  • C#.NET RasterEdge image resizing SDK FAQs
C# Image Resizing Control Features
  • Professional and easy-to-use C#.NET image resizing control toolkit with royalty-free licenses
  • Robust and thread-safe .NET solution for image resizing in both Web-based and WinForms applications
  • Written in managed C# code and built in .NET Framework 2.0
  • Resized image file can be saved as a new independent image object by C# programming code
Resize Image in Visual C# Project
In this section, you will find detailed guidance on how to start a Visual C# .NET image resizing application using RasterEdge image resizer library control.
  1. Download and unzip RasterEdge DocImage SDK for .NET;
  2. Open or create a C#.NET class project in Microsoft Visual Studio 2005 or above versions;
  3. Embed following dlls of RasterEdge image resizing SDK to your C#.NET class application as references;
    • RasterEdge.Imaging.Basic.dll
    • RasterEdge.Imaging.Processing.dll
  4. Activate the evaluation license key of RasterEdge DocImage SDK for .NET by running the application file "RasterEdge.Imaging License Manager.exe" and copy created "RasterEdgeLicense.txt" to the C# project bin folder where above integrated RasterEdge image resizing dlls are located;
  5. Define the Namespace of RasterEdge C#.NET image resizing SDK;
  6. Copy the sample C# code (which you can find in following section) and you are able to resize the target image to meet your requirement.
Image Resizing Method in Visual C#
RasterEdge C#.NET image resizer library control offers an easy to use API for developers to resize target image file. The following is the method that this image resizing control has used to enlarge or reduce the target image size.
public static int ApplyResize(REImage img, int width, int height);
Sample C# Code to Resize Image
Using the sample C# code below, you can easily tailor the size of source image file to your desired requirement and save resized image as a new image object in .NET Windows Forms application.
From the given C# code demo, you will find it extremely easy to resize your source image file using RasterEdge C#.NET image resizing control. To put it in another way, if you want to adjust the target image size at your desired values, you just need to enter the required sizing value data by the C# code, that is, ImageProcessing.ApplyResize (reImage, image width value, image height value).
using RasterEdge.Imaging.Basic;
using RasterEdge.Imaging.Basic.Core;
using RasterEdge.Imaging.Processing;
using RasterEdge.Imaging.Basic.Codec;

namespace RE__Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string fileName = "c:/Sample.png";

REImage reImage = REFile.OpenImageFile(fileName);

ImageProcessing.ApplyResize(reImage, 500, 500);

REFile.SaveImageFile(reImage, "c:/reimage.png", new PNGEncoder());
}
}
}
C# Image Resizing Control FAQs
Q: Can I use RasterEdge image resize control to adjust the size of target image proportionally using Visual C# programming code?
A: If you want to resize your source image proportionally, maybe it is more suitable for you to use RasterEdge C#.NET image scaling control, which is designed to help C# developers scale image in an easy and quick way using Visual C# code.
More Tutorials!
Find more user guides with RasteEdge .NET Image SDK using Visual C# sample codings!


Recommend this to Google+