Rotate Image in Visual C#.NET

How to Rotate Image Through Simple Visual C# Imaging Method
The image rotation control contained in our .NET Image Processing SDK for C# can be used to rotate image by 90 degree, 180 degree, 270 degree or 360 degree in C#.NET application. This image rotation control is completed developed in the managed Visual C#.NET and is compatible with .NET Framework 2.0 or later versions. We also provide image processing support for .NET.
This C#.NET guide is provided to help developers quickly and easily complete image rotation with sample code. On this guide page, you will find some common reasons for rotating image in C#.NET, our simple method for image rotation, a specific example of rotating image in .NET application and other image processing functions for .NET image programming.
Reasons for Rotating Image in C#.NET
Why do we need to rotate image in C#.NET application? Rotating an image allows us to correctly display an image taken with a camera that is at reversed angle or a picture scanned in a scanner at a different angle. Besides, if a digital picture appears sideways, the best way to fix it is rotating the picture by 90 degree clockwise or counterclockwise. This works great for pictures turned on its side. Finally, if you would like to display your image vertically instead of horizontally, you can simply using our image rotation control for C#.NET to rotate your image.
C#.NET Method for Rotating Image
When rotated by 90 degree or 180 degree, most images may lose quality. However, our image rotation control enables you to rotate your target image without quality degrading by using defined C#.NET method. Images are composed of pixels and usually each pixel has a coordinate pair (x, y) which describes its position. Therefore, the method of rotating image is to change x and y coordinates of image pixel.
The method of using our image rotation control to rotate image is quite simple. You just need to download and unzip the trial version of our .NET Imaging SDK package and add Yiigo.Image.dll and Yiigo.Processing.dll to your project created in Visual Studio 2005 or later versions as references using C#.NET language. Then, you can call RotateImage API for image rotation in your C#.NET application.
Note: You can customize your image rotation by using C#.NET sample code given in the following part.
Example of Rotating Image in C#.NET
In this section, we will give you an example of rotating PNG raster image by 90 degree in C#.NET application. In addition to PNG image format, our C#.NET image rotation control also allows you to rotate tiff, jpeg, gif or bmp image format.
using Yiigo.Image;
using Yiigo.Image.Process;

namespace YG__Test
private void button1_Click(object sender, EventArgs e)
string fileName = "c:/demo.png";
YGPic ygPic = YGFile.OpenImageFile(fileName);

ImageProcess.RotateImage(ygPic, 90);
YGFile.SaveImageFile(ygPic, "c:/image.png", new PNGCreator());
If you want to get an example of rotating image through VB.NET programming, you can go to this VB.NET image rotation guide.
Other Image Processing Functions
Image rotation is just one function of our .NET Image Processing SDK. It also integrates other image processing functions in C#.NET application. For example, you are capable of changing the size of certain image through C#.NET programming using image resizing function. It empowers you to adjust image size freely in C#.NET to meet specific needs.
What's more, our .NET Image Processing SDK has a function of cropping image. It means that you are able to crop certain area of an image. In some situations, we just need certain part of a large-size image and the remained parts are unnecessary, you may use this image cropping function for your C#.NET imaging.
Finally, a useful function of our C#.NET Image Processing SDK is creating watermark on image. As we all know, content security is quite important. With this image processing SDK, C#.NET developers are able to create text-based or image-based watermark on source image in order to protect the image.
Imaging Solution
Yiigo.Image for .NET
Online C# Tutorial
C#: Yiigo.Image for .NETC#: How to StartC#: Doc Management SolutionC#: Web Doc ViewerC#: How to Deploy SDK
Doc & Image Formats
Advanced Functions
C#: Programming with Image SDKC#: Process ImageC#: Resize ImageC#: Crop Image
C#: Rotate Image
C#: Scale ImageC#: Flip ImageC#: Create ThumbnailC#: Create WatermarkC#: Annotate ImageC#: Callout AnnotationC#: Ellipse AnnotationC#: Freehand AnnotationC#: Hotspot AnnotationC#: Line AnnotationC#: Polygon AnnotationC#: Rectangle AnnotationC#: Rubber Stamp AnnotationC#: Text AnnotationC#: Convert ImageC#: Image to Byte ArrayC#: Image to StreamC#: Word to ImageC#: PDF to ImageC#: Draw on ImageC#: Draw Text on ImageC#: Draw Graphics on ImageC#: Barcode ReadingC#: Barcode GeneratingC#: Twain ScanningC#: OCR Recognition