I want to rotate a bitmap image I wrote some code and it work
TransformedBitmap TempImage = new TransformedBitmap();
TempImage.BeginInit();
TempImage.Sourc
How about this:
BitmapImage image = new BitmapImage();
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad;
image.UriSource = new Uri(ImagePath);
// here
image.Rotation = Rotation.Rotate270; // or 90, 0, 180
image.EndInit();
How about this?
var transformBitmap = (TransformedBitmap)image1.Source;
RotateTransform rotateTransform = (RotateTransform)(transformBitmap.Transform);
rotateTransform.Angle += 90;
image1.Source = transformBitmap.Clone();