Created
October 17, 2016 02:11
-
-
Save nuitsjp/c9f386a95c52819a5f2d52fc1247e0b8 to your computer and use it in GitHub Desktop.
Rotation BitmapSource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static BitmapSource Rotation(this BitmapSource source, int angle) | |
{ | |
if (source == null) throw new ArgumentNullException(nameof(source)); | |
var transformedBitmap = new TransformedBitmap(); | |
transformedBitmap.BeginInit(); | |
transformedBitmap.Source = source; | |
transformedBitmap.Transform = new RotateTransform(90); | |
transformedBitmap.EndInit(); | |
return transformedBitmap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment