I am wondering if someone might be able to help me solve a display issue. I want to simply allow for a clockwise rotation 90 degrees using the code below:
RotateTransform rotateTransform = new RotateTransform();
rotateTransform.CenterX = image1.Width / 2.0;
rotateTransform.CenterY = image1.Height / 2.0;
cW+= 90;
rotateTransform.Angle = cW;
TransformGroup transformGroup = new TransformGroup();
transformGroup.Children.Add(rotateTransform);
image1.RenderTransform = transformGroup;
In XAML, when I define the image height and width, the image WILL rotate. However, when set to auto the image disappears after this code is executed. Why is this happening and how can I solve this problem? Any help would be greatly appreciated.