You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to: Rotate Images with the .NET Framework | Microsoft Docs
ms.custom
ms.date
11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic
article
dev_langs
C++
helpviewer_keywords
GDI+ [C++], rotating images
graphics [C++], rotating images
ms.assetid
e32104d5-87d0-47a9-a22f-9bc835b7e8d7
caps.latest.revision
12
author
mikeblome
ms.author
mblome
manager
ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw
How to: Rotate Images with the .NET Framework
The following code example demonstrates the use of the xref:System.Drawing.Image?displayProperty=fullName class to load an image from disk, rotate it 90 degrees, and save it as a new .jpg file.
Note
GDI+ is included with Windows XP and is available as a redistributable for Windows NT 4.0 SP 6, Windows 2000, Windows 98, and Windows Millennium Edition. To download the latest redistributable, see http://go.microsoft.com/fwlink/?linkid=11232.
Example
#using <system.drawing.dll>
using namespace System;
using namespace System::Drawing;
int main()
{
Image^ image = Image::FromFile("SampleImage.jpg");
image->RotateFlip( RotateFlipType::Rotate90FlipNone );
image->Save("SampleImage_rotated.jpg");
return 0;
}