I rotate the image with animation with below code:
RotateTransform rtf = new RotateTransform();
image.RenderTransform = rtf;
image.RenderTransformOrigin = new Point(0.5, 0.5);
DoubleAnimation da = new DoubleAnimation();
da.From = 0;
da.To = 90;
da.Duration = TimeSpan.FromSeconds(1);
Storyboard storyboard = new Storyboard();
storyboard.Children.Add(da);
Storyboard.SetTarget(da, image);
Storyboard.SetTargetProperty(da, new PropertyPath("RenderTransform.Angle"));
storyboard.Begin();
If you want rotate image without anmiation, you can use below code:
image.RenderTransformOrigin = new Point(0.5, 0.5);
image.RenderTransform = new RotateTransform(90);
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.