I'm extremely new to WPF and I'm trying to figure out how it works... I currently have a canvas (ScrollViewer) that has an image shown on it. How do I rotate the image 90 degrees so that when I save it, it is saved at the 90 degree rotation?
I currently have the following...
private void BtnRotate_Click(object sender, RoutedEventArgs e)
{
RotateTransform rotateTransform = svImg.LayoutTransform as RotateTransform;
if (rotateTransform == null)
{
rotateTransform = new RotateTransform(90, 0, 0);
svImg.LayoutTransform = rotateTransform;
}
else
{
rotateTransform.Angle += 90;
}
svImg.VerticalAlignment = VerticalAlignment.Top;
svImg.HorizontalAlignment = HorizontalAlignment.Left;
}
But this only rotates the canvas. The image itself is still oriented the same way so when it's saved it does not have the rotation change on the new image.
Anyone know an easy way to rotate my image in the ScrollViewer?