I have a grid and grid contains an image. Grid bent on -52 degree on X Axis. this is rotated but not smoothly.
XAML code is:
<grid x:name="LayoutRootNew" grid.row="0" grid.columnspan="3" grid.rowspan="3" margin="11,40,0,0" verticalalignment="Top" xmlns:x="#unknown">
<grid.projection>
<planeprojection rotationx="-51" />
</grid.projection>
<Image Name="imgArrow1" Source="@../../Images/circle31mar.png" Stretch="Uniform" UseLayoutRounding="True" Height="340" Width="340" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image.Projection>
<planeprojection x:name="Image1Projection" centerofrotationx="0.5" centerofrotationy="0.5" />
</Image.Projection>
<Image.RenderTransform>
<rotatetransform x:name="Prize_ListWheel_Rotate">
Angle="0" />
</Image.RenderTransform>
</Image>
<Image Name="imgArrow2" Source="@../../Images/FRRingNew3.png" Margin="0,0,0,0" Height="222" Width="225" HorizontalAlignment="Center">
<Image.Projection>
<planeprojection x:name="Image1Projection2" centerofrotationx="0.5" centerofrotationy="0.5" />
</Image.Projection>
</Image>
</rotatetransform></grid>
.cs code is:
_n = gameDataBO.FRRndNumber;
SessionManager.newrandom = _n;
randomnumber = _n;
animanglerot = 360.0 / Convert.ToDouble(itextmaxcount);
anglesteps = Convert.ToInt64((itextmaxcount * 2 * numberofrotations - 38) * anglefactor);
imgArrow1.RenderTransformOrigin = new Point(0.5, 0.5);
imgArrow1.RenderTransform = new RotateTransform();
da = new DoubleAnimation();
da.From = 0;
da.To = -anglesteps;
anglesteps = anglesteps - 1;
Prize_ListWheel_Rotate.Angle += animanglerot / anglefactor;
da.Duration = TimeSpan.FromSeconds(2);
SineEase be = new SineEase();
be.EasingMode = EasingMode.EaseIn;
_nRing = gameDataBO.FRRingRndNumber;
SessionManager.newringrandom = _nRing;
_nRing = SessionManager.ringno;
imgArrow2.RenderTransformOrigin = new Point(0.5, 0.5);
imgArrow2.RenderTransform = new RotateTransform();
da2 = new DoubleAnimation();
da2.From = 0;
da2.To = 360.00 * 1;
da2.Duration = TimeSpan.FromSeconds(2);
_netRotation = (_n + _nRing);
if (_netRotation > 38)
{
_netRotation = (_netRotation % 38);
}
_finalAngle = _netRotation * (360.00 / 38.00);
Storyboard.SetTarget(da, imgArrow1.RenderTransform);
Storyboard.SetTarget(da2, imgArrow2.RenderTransform);
Storyboard.SetTargetProperty(da, new PropertyPath(RotateTransform.AngleProperty));
Storyboard.SetTargetProperty(da2, new PropertyPath(RotateTransform.AngleProperty));
sb1 = new Storyboard();
sb1.Children.Add(da);
sb1.Children.Add(da2);
sb1.Begin();
SessionManager.newsession = 0;
so i want to rotate that image along X axis clock wise for particular time period with different speed very smooth.
This works but roration is not smooth. i want to rotate my image as smooth. Please provide C# code for rotation.