Skip to content

Latest commit

 

History

History
60 lines (54 loc) · 1.61 KB

how-to-rotate-images-with-the-dotnet-framework.md

File metadata and controls

60 lines (54 loc) · 1.61 KB
title 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;  
}  

See Also

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