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

How to C#: Rotate Image according to Specified angle


Tutorial for How to Rotate Image



Related .net document control helps:
asp.net dnn pdf editor: ASP.NET DNN PDF Editor Control: view, edit PDF files in Dotnetnuke application
asp.net annotate pdf: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
asp.net webforms document viewer: ASP.NET WebForms application document viewer control: view, annotate, redact, convert files online in ASP.NET
asp.net sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net document viewer: ASP.NET Document Viewer Control in C#: View, Annotate, Redact web document files in ASP.NET using C#
asp.net powerpoint document viewer: ASP.NET PowerPoint Document Viewer Control: view pptx files online in C# using ASP.NET
asp.net edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#


Steps to Rotate image



Load an image with RasterImage object.


Create an image processor with ImageProcess object.


Call the method RotateImage of ImageProcess object to complete the task rotating image.


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


In order to acheive the work, please refer to the following steps.




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;


  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.




How to Rotate Image



By using the XImage.Raster SDK, you can rotate the image according to the specified angle.


Sample Code (rotate image):




RasterImage img = new RasterImage(@"F:\input.tif");
ImageProcess process = new ImageProcess(img);
//Rotate image, the target angle is 30(clockwise), and the negative value will give you a anticlockwise rotate.
process.RotateImage(30);
//If the input image has multiple frames,>
//it will only rotate the second page of the input tif
process.RotateImage(30, 1);
img.Save(@"C:\output.tif">);