Files
docs-desktop/dotnet-desktop-guide/framework/wpf/controls/how-to-rotate-an-image.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

20 lines
1010 B
Markdown

---
title: "How to: Rotate an Image"
ms.date: "03/30/2017"
dev_langs:
- "csharp"
- "vb"
helpviewer_keywords:
- "images [WPF], rotating"
- "rotating images [WPF]"
ms.assetid: 863fe998-9a6b-490d-bd86-6ef5c9ec6d75
---
# How to: Rotate an Image
This example shows how to rotate an image 90 degrees by using a <xref:System.Windows.Media.Imaging.BitmapImage.Rotation%2A> property of a <xref:System.Windows.Media.Imaging.BitmapImage>.
## Example
[!code-xaml[ImageElementExample_snip#TransformedXAML2](~/samples/snippets/csharp/VS_Snippets_Wpf/ImageElementExample_snip/CSharp/TransformedImageExample.xaml#transformedxaml2)]
[!code-csharp[ImageElementExample_snip#TransformedCSharp1](~/samples/snippets/csharp/VS_Snippets_Wpf/ImageElementExample_snip/CSharp/TransformedImageExample.xaml.cs#transformedcsharp1)]
[!code-vb[ImageElementExample_snip#TransformedCSharp1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ImageElementExample_snip/VB/TransformedImageExample.xaml.vb#transformedcsharp1)]