How to: Rotate Images with the .NET Framework

The following code example demonstrates the use of the System.Drawing.Image class to load an image from disk, rotate it 90 degrees, and save it as a new .jpg file.


#using <system.drawing.dll>  

using namespace System;  
using namespace System::Drawing;  

int main()  
   Image^ image = Image::FromFile("SampleImage.jpg");  
   image->RotateFlip( RotateFlipType::Rotate90FlipNone );  
   return 0;  

See Also

.NET Programming with C++/CLI (Visual C++)