How to C#: Imaging
Using Imaging SDK for C#.NET
Winforms Controls
Image Load
Image Access and Modify
Geometry: Resample
Geometry: Resample
  |  
Home ›› XImage.Raster ›› C# Raster: Resample Image

How to C#: Resample Image


Tutorial for How to Resample Image



Related .net document control helps:
asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
asp.net edit pdf text: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net pdf viewer: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#


Steps to Resample image



Load an image with RasterImage object.


Create an image processor with ImageProcess object.


Call the method ResampleImage of ImageProcess object to complete the task flopping image.


Save the resampled image to an image file on the disk.


In order to acheive the work, please refer to the following steps. read pdf in asp.net c#, vb.net pdf reader, vb.net print pdf file silently, c# pdf viewer free, add image watermark to pdf c#, c# data matrix.




Install XImage.Raster in C# Project



Add necessary references to your C#.NET project. Right-click the project and select "Add Reference..." to locate and add the following DLLs as project references; add text to pdf using itextsharp c#, c# print to pdf, c# remove pdf metadata, pdf to text vb.net, vb.net print pdf to specific printer, vb net pdf add page count, convert pdf to bitmap vb.net.


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use corresponding namespaces;


  using RasterEdge.XImage.Raster;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.




Sample code to Resample Image



By using the XImage.Raster SDK, you can modify the image size and orientation by assigning it to the processor. Unlike the resize image, resample image will  resize the image without color mixing, so it is much faster than resize. embed pdf in mvc view, asp.net tiff viewer, asp.net show excel file in browser, asp.net pdf editor component, pdf preview in asp net c# example, asp.net c# pdf viewer, asp.net remove image from pdf file.


Sample Code (resample image):




RasterImage img = new RasterImage(@"C:\input.tif");
ImageProcess process = new ImageProcess(img);
//Resample all the pages, do not respect the aspect ratio, the target size is 100x100.
process.ResampleImage(new Size(100, 100), false);
//If the input image has multiple frames,
//it will just resample the second page of the input tif.
process.ResampleImage(new Size(100, 100), false, 1);
img.Save(@"C:\output.tif");